Magento - send forgot password email in the customer's language

送分小仙女□ 提交于 2019-12-11 05:27:06

问题


I have a Magento website with 2 languages, when I send a new password to customer from backend, he received an email in the wrong language, but when he request for a new password from the frontend, he received an email in the correct language.

How can I send the "forgot password email" in the appropriate language (in which the client is created) from the backend ?

Thanks for help :)


回答1:


Step by Step

  1. System -> Transactional Emails
  2. Click "Add New Template", fill necessary infos
  3. Choose the template "New Password" from drop-down list
  4. Choose your "locale" or "language settings" from drop-down list
  5. Click load template, change what you want ( for instance logo )
  6. System -> Configuration -> Customer Configuration
  7. Click "Password Options" then assing your new email template for "forgot password"

Almost the forgot, you should select store ( I mean related store which is language based ) from "current configuration scope" from upper left corner in configuration section when you set "customer configuration"




回答2:


I have managed to send Forgot Password Email from localhost.

Only thing you need to do is follow the steps listed below and your done.

  1. Modify this page app/code/core/Mage/Core/Model/Email/Template.php

Comment the existing functionality and add the below code

    public function getMail()
    {
     if (is_null($this->_mail)) {
        /* changes begin */
       $my_smtp_host = Mage::getStoreConfig('system/smtp/host');
       $my_smtp_port = Mage::getStoreConfig('system/smtp/port');
       $config = array(
                'port' => $my_smtp_port,
                'auth' => 'login',
                'username' => 'your username',
                'password' => 'your password'
            );
        $transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
        Zend_Mail::setDefaultTransport($transport);
        /* Changes End */
        $this->_mail = new Zend_Mail('utf-8');
    }
    return $this->_mail;
}
  1. Login to admin System -> Configuration -> Advanced -> System -> Mail Sending settings and set the following things.

    Disable Email Communications = No

    Host = smtp.mandrillapp.com

    Port (25) = 587

    Set Return-Path = No

  1. Login to admin System -> Transactional Emails -> Add New Template follow these steps

    • In Load default template - select the required template like 'Forgot Password' and click on the Load Template a default template will be be populated in the template content

    • In Template Information - Provide any template name like Forgot Password and click on save template.

  2. Login to admin System -> Configuration -> Customers -> Customer Configuration -> Password Options

    • In Forgot Email Template select 'Forgot Password' (which was created in Transactional Emails tab) from the drop down.

    • Select Remind Email Template to 'Forgot Password'

    • Select Forgot and Remind Email Sender to any drop down value for ex - customer support.

Note - Make Sure the customer support is set to some valid email address. In order modify the customer support email - Login to admin System -> Configuration -> General -> Store email Address -> Customer support add the valid email address.

That's all your done. Please feel free to post your queries. For more info refer this http://pravams.com/2011/07/30/magento-send-email-using-smtp/



来源:https://stackoverflow.com/questions/8655332/magento-send-forgot-password-email-in-the-customers-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!