The Messenger of Allah ﷺ came to us while we were in the gathering of Saad bin Ubada.Bashir bin Saad said to him, "Allah has commanded us to send blessings upon you, Messenger of Allah. How should we send blessings upon you?"The Messenger of Allah ﷺ remained silent for so long that we wished he had not asked him. Then he said, "Say, 'O Allah, send blessings upon Muhammad and upon the family of Muhammad, as You sent blessings upon Ibrahim. And bestow favor upon Muhammad and upon the family of Muhammad, as You bestowed favor upon the family of Ibrahim among all peoples. Indeed, You are Praiseworthy and Glorious.' And the salutation is as you already know."
أتانا رسول الله ﷺ في مجلس سعد بن عبادة: فقال له بشير بن سعد: أمرنا الله أن نصلي عليك يا رسول الله، فكيف نصلي عليك؟ قال: فسكت رسول الله ﷺ حتى تمنينا أنه لم يسأله ثم قال: قولوا: اللهم صل على محمد وعلى آل محمد، كما صليت على إبراهيم، وبارك على محمد وعلى آل محمد كما باركت على آل إبراهيم في العالمين، إنك حميد مجيد، والسلام كما علمتم.
Malik narrated it in Qasr Salah (67) from Naeem bin Abdullah Mujmir, from Muhammad bin Abdullah bin Zayd, that he was told by Abu Masud Ansari, and he related it.Muslim narrated it in Salah (405) from Yahya bin Yahya, from Malik, similarly.Ibn Khuzayma (711) and others added, "How should we invoke blessings upon you when we invoke blessings upon you in our prayer?"