Alms and charitable gifts do not become unlawful by mentioning the names of Allah’s choicest servants or one’s deceased relatives. That is because the intention is to donate the reward of those acts to them. It is not included in the ruling of the verse :And that(animal) on which the name of someone other than Allah has been invoked whilst slaughtering.
In the Shariah, it is permissible for one to donate his or her righteous action or charitable gift to another person. Let us take a look at sayings of Allah’s Messengerﷺ that prove the permissibility of Isaal al-Thawab (presenting one’s reward to the deceased).
Hadith #1
Our mother Sayyida Ayesha(RA) said,” A man said to the Prophetﷺ,“My mother died suddenly and I think if she could have spoken[at the time of her death] she would have given charity. Will she be rewarded if I give charity on her behalf?” The Prophetﷺ said, “Yes.”►[Narrated by al-Bukhari in al-Sahih, Kitab al-Janaiz,Chapter Sudden Death,1:467, Hadith #1322;Muslim in al-Sahih :Kitab al-Zakat,2:696 Hadith #1004;Abu Dawud in al-Sunan : Kitab al-Wasaya,3:118, Hadith #2881]
Hadith #2
Hadrat Abu Hurayra(RA) said, “A man said to the Prophetﷺ,”My father has died and left behind wealth, but did not issue any bequest regarding it,so will sins be expiated if I spend it in charity on his behalf?”
The Prophet ﷺ replied, “Yes.”►[Narrated by Muslim in al-Sahih,al-Wasiya,3:1254, Hadith #1630;al-Nasai in al-Sunan 6:251 Hadith #3652;Ibn Majah in al-Sunan Kitab al-Wasaya 2:206,Hadith #2716;Ahmed b. Hanbal in al-Musnad 2:371, Hadith #8828 and Ibn Khuzayma in al-Sahih 4:123,Hadith #2498]
Hadith #3
According to Ibn Abbas(RA): “A man said: ‘O Messenger of Allah, my mother has died, so would it benefit her if I donated to charity on her behalf?’ He said: ‘Yes,’ So the man said: ‘I have an orchard, so I call upon you to bear witness that I have donated it to charity on her behalf!’” ►[•al-TirmidhÏ in al-Sunan, Bk.: al- Zakat [The Alms-due] according to Allah’s Messenger ﷺ, Ch.: What has come to us about charitable donation on behalf of the deceased, 3/56 §669. •Abu Dawud in al-Sunan,Bk.: al-Wasiya[Bequests], Ch.: What has come to us about someone who dies, leaving a bequest from which charitable donations are made, 3/118 §2882. •al-Nasai in al-Sunan, Bk.: al-Wasiya[Bequests], Ch.: The excellent merit of charitable donation on behalf of the deceased, 2/252 §3655. & in al-Sunan al-Kubra, 4/110 §6482. •al-Hakim in al-Mustadrak, 1/581 §1531.•Ibn Khuzayma in al-Sahih, 4/125 §2502. •Ahmad b. Hanbal in al-Musnad,1/370 §3504.]
Hadith #4
According to Hadrat Sad b. Ubada(RA), his mother died, so he said: “O Messenger of Allah, my mother has died, so should I donate to charity on her behalf?”
He said: “Yes,”
so he said: “Which charitable donation is preferable?”
He said: “The provision of water.”
(He purchased a well and dedicated it to the Muslims.)
That (became known as) watering place of Sad, or the family of Sad, in Medina.
►[•al-Nasai in al-Sunan, Bk.: al-Wasaya [Bequests], Ch.: Concerning the disagreement with Sufyan, 6/254-5 §3662-6 and in al-Sunan al-Kubra, 4/112 §6491. •Ibn Majah in al-Sunan: Bk.: al-Adab [Proper Conduct], Ch.: The excellent merit of the charitable donation of water, 2/1214 §3684. •Ahmad b. Hanbal in al-Musnad, 5/284 §22512. •al- Tabarani in al-Mujam al-Kabir, 6/20 §5379. •al-BayhaqÏ in Shuab al-Iman, 3/221 §3379. •al-MundhirÏ in al-Targhib wa al-Tarhib, 2/42 §1423-4]
Hadith #5
Imam Sufiyan Al-Thawri narrated: “The dead are undoubtedly tested for seven days in their graves, and it is for this reason that people deemed it praiseworthy to serve food on their behalf during those days.”
Imam al-Suyuti said regarding this narration:”The chain of transmission of this narration is authentic.”►[Abu Nuaym ,Hilya al Awliya,4:11 and Al-Suyuti ,al-Dibaj ala Sahih Muslim ,2:491 Hadith #905;Sharh ala Sunan al-Nasai,4:104]
These narrations prove that it is both permissible and a Sunna to donate good deeds on behalf of the deceased(Isal al-Thawab) and associating righteous actions to their names.
– Reference Book – Divine Oneness (Kitab al-Tawhid,Vol II , Page 132-133)