The right of him through whom God makes you happy (surur) is that you first praise God, then you thank the person.

وحق من سرك الله تعالى به أن تحمد الله عزوجل أولا ثم تشكره