客户的密码未显示在电子邮件模板magento 1.9.1.0中

ome*_*ndr 1 passwords magento email-templates

我在电子邮件中显示密码时遇到问题(account_new.html)

<strong>Email</strong>: {{var customer.email}}<br/>
<strong>Password</strong>: {{htmlescape var=$customer.password}}<p>
Run Code Online (Sandbox Code Playgroud)

注册后密码未显示在模板中.我怎样才能解决这个问题?我使用magento 1.9.1.0

小智 6

Magento 1.9版本在电子邮件中发送密码有问题.并且不设置var值{{htmlescape var=$customer.password}}

有一种解决方案可以在电子邮件中发送密码

打开核心文件或按照您喜欢的AccountController.php扩展,找到第createPostAction()285行的功能或查找

$customer->cleanPasswordsValidationData();
Run Code Online (Sandbox Code Playgroud)

只是这样评论

// $customer->cleanPasswordsValidationData();
Run Code Online (Sandbox Code Playgroud)

也可以在第809,954行的其他地方进行

现在它将密码发送给客户的新帐户电子邮件.

其他方法

打开或扩展自定义模型文件

Magento的\ APP \代码\核心\法师\用户\型号\ Customer.php

找到功能

public function cleanPasswordsValidationData()
{
    $this->setData('password', null);
    $this->setData('password_confirmation', null);
    return $this;
} 
Run Code Online (Sandbox Code Playgroud)

评论出来 // $this->setData('password', null);

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