[Machine] It is narrated from her grandmother Fatimah, the daughter of the Messenger of Allah ﷺ , who said, "When the Messenger of Allah ﷺ entered the mosque, he would offer greetings and say, 'O Allah, forgive my sins and open the doors of Your mercy for me.' And when he left, he would offer greetings and say, 'O Allah, forgive my sins and open the doors of Your grace for me.' Isma'il said, 'I met Abdullah ibn Hasan and asked him about this hadith, and he said, 'When he entered, he would say, 'O Lord, open for me the door of Your mercy.' And when he left, he would say, 'O Lord, open for me the door of Your grace.'
كَانَ رَسُولُ اللهِ ﷺ إِذَا دَخَلَ الْمَسْجِدَ صَلَّى عَلَى مُحَمَّدٍ وَسَلَّمَ وَقَالَ اللهُمَّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ وَإِذَا خَرَجَ صَلَّى عَلَى مُحَمَّدٍ وَسَلَّمَ ثُمَّ قَالَ اللهُمَّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ فَضْلِكَ قَالَ إِسْمَاعِيلُ فَلَقِيتُ عَبْدَ اللهِ بْنَ حَسَنٍ فَسَأَلْتُهُ عَنْ هَذَا الْحَدِيثِ فَقَالَ كَانَ إِذَا دَخَلَ قَالَ رَبِّ افْتَحْ لِي بَابَ رَحْمَتِكَ وَإِذَا خَرَجَ قَالَ رَبِّ افْتَحْ لِي بَابَ فَضْلِكَ