This resignation letter is only for an employee who is resigning from a particular position, not the company itself.
Dear Mr./Ms. Bossname
As we previously discussed, the promotion that I applied for at (company site) has been approved and I am slated for a transfer. It is therefore my unfortunate duty to tender my resignation as (position) at (site), effective (date).
I am incredibly grateful to you for being such a patient and dedicated mentor during my time at this site. I am pleased to be staying at (company), but sorry that my career path is moving me away from my team and this location. The help and experience you provided are greatly appreciated.
I am thankful to be working for a company that allows opportunities for growth and personal betterment, and I wish you the best of luck here at (site).