How to say "thank you for ..."?
Same as English just without the for.

谢谢 + what.

"thank you for the gift" = 谢谢 + 礼物 － maybe you would say 你送给我的礼物 or just 你的礼物

"you for inviting me for dinner" = 谢谢 + 邀请 + 晚餐 - so altogether you would say 谢谢你那天邀请我吃晚饭 (which is for what already happened - seeing as you're writing a card, so obviously you're thanking for the dinner you've already eaten and not just for the invitation for an upcoming dinner)