It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that he was asked: Is the ritual bath (ghusl) on Friday obligatory? He said: No, but I prefer to take a bath, and whoever does not bathe, it is not obligatory upon him. And now I will tell you how this came about: The people were in hardship; they wore wool and worked carrying loads on their backs, and their mosque was narrow, and its roof was merely a shelter (made of branches). One hot day the Messenger of Allah (peace and blessings be upon him) came out, and (the people) had sweated in that wool until a foul smell spread, to the extent that they were causing one another harm by it. the Prophet (peace and blessings be upon him) noticed that smell, and then the Messenger of Allah (peace and blessings be upon him) said: "O people, when it is this day, take a bath, and let each of you apply the best oil and perfume he can find."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11499