【问题标题】:Magento change password reset email templateMagento 更改密码重置电子邮件模板
【发布时间】:2012-05-16 16:03:15
【问题描述】:

我正在使用 magento 1.6.1.0 构建一个电子商务网站。我正在使用一种扩展程序,它会强制用户在进入网站之前登录。一切正常,问题仅在于忘记密码重置链接。该扩展程序也阻止了此重置密码链接。我没有得到那个扩展团队的任何支持。

今天早上我在电子邮件模板中工作以更改 magento 默认徽标。那时我有一个想法,在创建新帐户时,我们将获得电子邮件、密码的详细信息。为什么我们不能使用该电子邮件模板而不是重置密码链接模板?

我尝试将所有内容从account_new.html 复制粘贴到account_password_reset_confirmation.htmlapp/locale/en_US/template/email

完成这些更改后,我收到一封电子邮件,其中包含 emailL:xxx@mydomain.com 和密码:

我收到的邮件是空密码字段。

请指导我将忘记密码的模板从account_password_reset_confirmation.html更改为account_new.html,以便我可以直接发送密码。

【问题讨论】:

    标签: email templates magento forgot-password


    【解决方案1】:

    如果您使用,我可以调试您的代码

    $customer = Mage::getModel("customer/customer");
             $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
             $customer->getPassword();
    

    它不会工作。 密码将在数据库中加密。所以你不能利用它。唯一的方法是生成新密码并在数据库中更新它并将新密码发送到用户邮件。

    生成自定义密码的示例代码

    $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";     //Random password generation
                 $pass = array(); //remember to declare $pass as an array
                 $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
                 for ($i = 0; $i < 6; $i++) {
                     $n = rand(0, $alphaLength);
                     $pass[] = $alphabet[$n];
                 }
                 $newpassword =implode($pass);
    

    【讨论】:

      猜你喜欢
      • 2017-02-26
      • 1970-01-01
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      • 1970-01-01
      • 2011-04-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多