Deeds Are Only by Intentions
ʿUmar reported that the Messenger of Allah ﷺ said:
“Actions are judged by intentions, and every person shall have only what he intended.
Whoever’s migration is for Allah and His Messenger, then his migration is for Allah and His Messenger.
And whoever’s migration is for some worldly gain he seeks or a woman he wishes to marry, then his migration is for whatever he migrated for.”
Intention in Deeds
Abū Masʿūd reported that the Prophet ﷺ said:
“When a man spends on his family seeking reward for it, it is counted for him as charity.”
Sincerity in Intention
Saʿd ibn Abī Waqqāṣ reported that the Messenger of Allah ﷺ said:
“You will never spend anything seeking thereby the Face of Allah except that you will be rewarded for it — even what you place in your wife’s mouth.”