Search code examples
magentopasswordsemail-templates

customer's password not displayed in email templates magento 1.9.1.0


I have a problem with displaying the password in email (account_new.html)

<strong>Email</strong>: {{var customer.email}}<br/>
<strong>Password</strong>: {{htmlescape var=$customer.password}}<p>

After registration password is not displayed in the template. How can I fix this? I use magento 1.9.1.0


Solution

  • Magento 1.9 version has problem to send password in emails. and not set var values under {{htmlescape var=$customer.password}}

    There is one solution to send password in email

    Open the core file or extend as you like AccountController.php, find the function createPostAction() on line 285 or find

    $customer->cleanPasswordsValidationData();
    

    just comment it like this

    // $customer->cleanPasswordsValidationData();
    

    also do it in other places as on line 809, 954

    now it sends the password to customer new account email.

    Other method

    open or extend the custom model file

    magento\app\code\core\Mage\Customer\Model\Customer.php

    find the function

    public function cleanPasswordsValidationData()
    {
        $this->setData('password', null);
        $this->setData('password_confirmation', null);
        return $this;
    } 
    

    comment out // $this->setData('password', null);

    public function cleanPasswordsValidationData()
    {
        // $this->setData('password', null);
        $this->setData('password_confirmation', null);
        return $this;
    }