He spoke about his charity — does this cancel the donation?
Question
Answer
Shalom u’vracha
It does not say that someone who speaks about his tzedakah does not receive reward. It says (Shulchan Aruch, Yoreh Deah, siman 249, se’if 13): “A person should not boast about the tzedakah that he gives.” In other words, the problem exists only when the donation is made for the sake of pride and self-glorification. Therefore, in that same paragraph it says: “One who dedicates something to tzedakah is permitted to write his name on it so that it will be a remembrance for him, and it is proper to do so.” From this it is clear that there is no problem at all that people know who donated.
The Rashba (Shu"t, part 1, siman 1541) writes that, ideally, it is proper to publicize the giving of tzedakah when the goal is to encourage other people to donate.
[Note: Even in a case where indeed there would be no reward for the mitzvah, it is generally forbidden to cancel the donation, since this is considered a “neder mitzvah” (a vow concerning a mitzvah). But in this case there is certainly full reward for the mitzvah, without any doubt].