Imam Hasan al-Basri (may Allah have mercy on him) says that Sayyiduna Aqil bin Abi Talib (may Allah be pleased with him) came to Basra and married a woman from Banu Jusham. According to custom, people congratulated him and said: «بالرفاء والبنين» (that is, congratulations on your marriage with hopes of goodness, blessing, harmony, affection, and sons). Upon this, he said: Do not say this; the Messenger of Allah (peace and blessings be upon him) forbade us from saying «بالرفاء و البنين» and instructed us to say: «بَارَكَ اللّٰهُ لَكَ وَبَارَكَ عَلَيْكَ», meaning "May Allah bless you and may blessing be upon you."
Brief Explanation
(Commentary on Hadith 2209)
«الرِّفَاءِ وَالْبَنِيْنَ» Saying this for the groom was also not something particularly bad, but since it implied that the birth of daughters was not liked by them, for this reason it was prohibited. In any case, after marriage, saying «بَارَكَ اللّٰهُ لَكَ وَبَارَكَ عَلَيْكَ وَجَمَعَ بَيْنَكُمَا فِي خَيْر» for the groom is itself Sunnah, as will be mentioned later.