Simply replace the unfilled areas such as "" and "[date]" with your information.
Dear [name of teacher],
Thank you for taking the time to write a letter of recommendation letter for me to [state opportunity requiring letter]. I would like to let you know that I have [received the position/been admitted to the school/been accepted into the organization/etc], and I feel that your letter played an important role in that success.
Thank you again for taking the time, and for providing me with such an excellent letter of recommendation. I really appreciate all you have done for me over the years. The things I learned in your classroom will certainly help me in many future endeavors.