It was narrated that ‘Umar bin Al-Khattab (may Allah be pleased with him) said: “The Messenger of Allah صلی اللہ علیہ وآلہ وسلم said: ‘Actions are only done with intentions, and every man shall have what he intended. Thus he whose emigration was for Allah and His Messenger, his emigration was for Allah and His Messenger, and he whose emigration was to achieve some worldly benefit or to take some woman in marriage, his emigration was for that which he intended.” (Sahih)