The Shemen HaTov offers the following explanation of the pasuk:
”Hanistarim LaHashem Elokeinu,
VeHaniglot Lanu Ulevaneinu Ad Olam” -
"Hidden things may pertain to God our Lord,
but that which has been revealed
applies to us and our children forever."
- Devarim 29:28
(The crux of what I’m presenting here is based on the Shemen HaTov.
I have embellished and expanded on the idea.)
Really, mitzvot should only be between G-d and us (for Hashem what we do should be nistarot). Our own needs dictate that we publicize what we do, for the sake of our children as well as others (though, for our sake actions should be niglot). Children especially need to know about the Tzedaka , Torah, and Chesed of their parents because they learn through that example.
The Yalkut Shimoni says that when Elkana set out on his holiday pilgrimage he would camp out at a different spot in order to educate new people regarding the mitzvah of Aliya LaRegel. Rav Aron Kotler said based on this that we should tell others about the mitzvot we do, in order to teach and inspire them. Rabbi Paysach Krohn cited these two sources and gave the example of his wife telling her high school students about her involvement in the local Chevra Kadisha because it’s something they might not learn about otherwise.
On the other hand, the Zohar that says that if you do a mitzvah and tell someone, you lose the mitzvah. The message is that a mitzvah’s value should be the mitzvah itself, the relationship between you and G-d. Telling someone about the good you’ve done shows a need for something other than the act itself to make you feel good about what you’ve done. According to this quote G-d says if that’s what you want then you get that instead of the mitzvah itself.
Jeff Korbman once came across the following explanation of the Sfas Emes regarding the Seder. The Matzah is the main mitzvah of the night, and the fact that it is covered or uncovered at various times reflects the idea we’ve been discussing. When there is some educational purpose, then the Matzah is uncovered in order for our children to see it and learn from it. When there is nothing taking place that is educational in nature then proper etiquette is to cover our matzah/mitzvah.
If a person's intent is to teach others, and that is a viable possibility, then one can/should make his mitzvah known. If someone makes his positive actions known in order to feel good about what he's done it is less than ideal. Things like telling a classmate about one's extra learning or having a donation amount announced could be important lessons for others or they could be things we do for our own honor.
Deep inside our hearts know the truth.
Have a great Shabbos,
Rabbi Neil Fleischmann