How to create a reset password link in magento and then send the mail to the corresponding customer.I have referred this link:
1)http://stackoverflow.com/questions/19034753/magento-customer-password-reset-email
But i don't know what is going inside that code.So kindly answer to solve this.I want to done it manually(programmatically)
I think something like this should work:
/** @var $customer Mage_Customer_Model_Customer */
$customer = Mage::getModel('customer/customer')
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
->loadByEmail($yourCustomerEmail);
if ($customer->getId()) {
try {
$newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
$customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
$customer->sendPasswordResetConfirmationEmail();
} catch (Exception $exception) {
Mage::log($exception);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With