【问题标题】:Reset Password failed in magento在magento中重置密码失败
【发布时间】:2013-05-12 09:51:19
【问题描述】:

在我们的 Magento 应用程序中,我们使用交易电子邮件模板发送重置密码邮件。

当我们点击忘记密码窗口中的submit按钮时,将根据电子邮件模板发送一封电子邮件...

以下是Accountcontroller中的代码

$newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
                    /*$customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
                    $customer->sendPasswordResetConfirmationEmail();*/
                    $templateId = "Reset_password_user";
                    $flname = $customer->getFirstname().' '.$customer->getLastname();
                    $emailTemplate = Mage::getModel('core/email_template')->loadByCode($templateId);
                    $vars = array('name' => ucwords($flname), 'userid' => $customer->getId(), 'tocken' => $newResetPasswordLinkToken);
                    $emailTemplate->getProcessedTemplate($vars);
                    $storeId = Mage::app()->getStore()->getStoreId();
                    $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));
                    $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));
                    $emailTemplate->send($email,ucwords($flname), $vars);

邮件内容如下:

There was recently a request to change the password for your account.
If you requested this password change, please click on the following link to reset your password: http://mywebsite.com/index.php/customer/account/resetpassword/?id=3607&token=f74609505166ef132345ba78539e6b90
If clicking the link does not work, please copy and paste the URL into your browser instead.

If you did not make this request, you can ignore this message and your password will remain the same.

那么这里的问题是什么?

当我点击邮件中的链接时,它会加载忘记密码的链接,并显示一条错误消息:

Your password reset link has expired.

【问题讨论】:

    标签: magento magento-1.7 forgot-password


    【解决方案1】:

    您应该检查可能导致与此功能冲突的插件,我也有类似的问题,删除 unirgy 礼券插件有助于解决问题,这也可能不是由于插件本身,而是配置错误.

    【讨论】:

      【解决方案2】:

      我有同样的问题,默认邮件模板名称的问题:忘记密码

      在这个模板中找到下面一行

      <a href="{{store url="customer/account/resetpassword/" _query_id=$customer.rp_customer_id _query_token=$customer.rp_token}}"><span>Reset Password</span></a>
      

      并替换为以下行:

      <a href='{{store url="customer/account/resetpassword/" _query_id=$customer.id _query_token=$customer.rp_token}}'><span>Reset Password</span></a>
      

      您只会看到引号问题。

      希望这会对您有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-07-20
        • 2014-07-06
        • 1970-01-01
        • 2013-05-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多