The grammar is is fine, but it doesn't really sound like something a native would say. There are lots of ways to express the thought. You might say:
When customers thank me, it keeps me going.
When customers thank me, I forget that I'm tired.
When customers thank me, it makes my day.