The Duties of the Heart, by Rabbi Bachye, tr. by Edwin Collins, , at sacred-texts.com
It is quite clear to me that even the duties of the body and its members can never be perfectly fulfilled, except with a willing heart, and a soul that delights to do them, and when our heart is really full of yearning for the work that they involve. And should the thought arise in our minds that our moral obligation requires only outward acts of goodness, and that our hearts are not in duty bound to choose
the service of The Infinite * and to delight in it, then the obligation to ethical conduct would also be removed from the body and its members. For no act of any kind is done completely unless the soul delights in doing it.
Moreover, with regard to any sinful conduct, it is not the act itself, but the sinful intention, by which one incurs guilt. It is only when the heart co-operates with the bodily members in the commission of an offence that guilt is incurred; so that it is the intention of the heart that is the principal element in either virtue or vice, and he who does a meritorious action unintentionally is still without merit. Thus the essential thing in all conduct is the intention of the heart.
21:* The Rabbis frequently used this term for God. Hashem = The name, i.e., the Divine name of four letters, derived from hajah, to exist, which was thought too sacred to pronounce in come-on speech, and the meaning of which connotes absolute, infinite existence.