"In order for an action to be accepted in the court of Allah Ta'ala, it must be done solely for His Pleasure and in accordance to the Sunnah of Rasulullah salallahu alayhi wasallam." Ibn Kathir Rahimahullah. Just having a good intention alone doesn't suffice.