In your system configuration, customer accounts are shared by website, so the loadByEmail
method needs to be used on a customer model that has a value for website_id
, and this website ID must correspond to the website to which the customer is associated.
Or, as your controller seems to be an admin one, Mage::app()->getWebsite()->getId()
returns 0, which does not correspond.
So, your solution is either to share customer accounts globally (System > Configuration > Customers > Customer Configuration > Account Sharing Options), as it won't change much things if you only run a single website, either to use a website ID that has to be specified by an user, or at least not retrieved by Mage::app()->getWebsite()->getId()
.