Congratulations / Many congratulations / We congratulate you (most sincerely) on the (arrival of the) new baby / on passing the exam / on the new job / on your promotion / on your engagement.
[infml] I was delighted to hear of your success in the exam. Well done!
I have just heard the wonderful news of your forthcoming marriage and offer you my sincerest / heartiest congratulations and best wishes for your future happiness.
[infml] - nieformalnie

