The one who plants something will receive ongoing reward, even after his death
Question

Will the one who plants palm trees, crops or other plants attain reward after he dies in addition to his heirs benefitting from these palm trees?
Praise be to Allah.Yes, it is proven from the Messenger of Allah (blessings and peace of Allah be upon him) that he said: “There is no Muslim who plants a plant or sows a crop, from which birds, humans or animals eat, but he will have the reward for an act of charity from it.”
For these plants and crops that the Muslim plants, whether they are palm trees or any other kind of trees will have reward, and for those that take from them, such as animals that graze on these plants, or birds that eat from them, or humans who pass by them and eat, he will have the reward of charity for that. The same applies to what is taken and given in charity to people, or what is given to the members of his household. All of that is the good deeds for which he will be rewarded as a result of this planting. End quote.
Shaykh ‘Abd al-‘Aziz ibn Baz (may Allah have mercy on him).
Fatawa Nur ‘ala ad-Darb (2/1215).