As for the details of whether someone should intend in what he undertakes, the fulfilment of an obligation or command, or seeking to be saved from punishment, or to gain a reward in the Hereafter, or to please Allaah, the Lord of His worshipers, then indeed his intention can encompass all of these.
book: https://taalib.link/30dayschangess preview: https://taalib.link/30dayschange