请教这个句子在语法上如何分析
Iamwritingthislettertothankyouforthehelpyougaveme.
1、Tothankyouforthehelp是状语吗?
2、yougaveme是什么成分?
3,是thatyougaveme省略了that的定于从句吗?
继续求助!到底是不是状语呢。。。