"When Messenger of Allah entered the Masjid he said Salat and Salam upon Muhammad and then said: (Rabbighfirli dhunubi, waftahli abwaba rahmatik) 'O pardon my sins, and open the gates of Your mercy for me.' And when he exited he said Salat and Salam upon Muhammad, and then said: (Rabbighfirli dunubi, waftahli abwaba rakmatik) 'O Lord pardon my sins, and open the gates of Your blessings for me.'" (Using translation from Tirmidhī 314)
عَنْ فَاطِمَةَ ابْنَةِ النَّبِيِّ ﷺ عَنِ النَّبِيِّ ﷺ قَالَتْ كَانَ إِذَا دَخَلَ الْمَسْجِدَ صَلَّى عَلَى مُحَمَّدٍ وَسَلَّمَ ثُمَّ قَالَ اللهُمَّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ وَإِذَا خَرَجَ صَلَّى عَلَى مُحَمَّدٍ وَسَلَّمَ وَقَالَ اللهُمَّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ فَضْلِكَ