Let’s say you want your customer to change his password. Nice way to do it is to send him a ‘reset password’ email. Here is the snippet:


    require 'app/Mage.php';


    $customer = Mage::getModel('customer/customer')->load(63);

    if ($customer->getId()) {
        try {
            $newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
            echo "CHECK YOUR EMAIL";
        } catch (Exception $exception) {
            echo "FAILED";

He will receive an email pointing him to the form where the new password should be entered. This is actually the same as going to the website and clicking the ‘forgot password?’ link and then entering the email to reset it.

I hope someone finds it useful.