She promised me she would write every week.

Literal

She [topic-は] every-week letter [object-を] write [quotative-と] I [to-に] promised.

手紙を書くと私に約束した — と marks the quoted promise. 約束する (やくそくする, 'to promise') takes に for the person promised to and と for the content.