Magento “Forgot Password” email sent in wrong language

前端 未结 8 1008
暗喜
暗喜 2021-01-19 10:34

I have a Magento site with multiple languages. I have setup the language packs and everything seems to translate properly on the website. Also the transactional e-mails are

8条回答
  •  花落未央
    2021-01-19 10:57

    The password reset email is send in Mage_Customer_Model_Customer::_sendEmailTemplate(). Here the emailtemplate is loaded. If it was loaded in admin in "Systemn > Transactional Emails" and configured to be used, your template will be used.

    Else the default template is loaded from file in Mage_Core_Model_Email_Template::sendTransactional. This is done using $this->loadDefault($templateId, $localeCode); The template ist loaded using

    $templateText = Mage::app()->getTranslator()->getTemplateFile(
                $data['file'], 'email', $locale
            );
    

    Here locale folders are checked in following order:

    1. Specified locale
    2. Locale of default store
    3. en_US locale

    The first matched locale is chosen. As Mage::app() doesn't know about the store which was passed with the emailtemplate, the default defaultstore is loaded, which is german in your case. It has nothing to do with the order of the locale folders.

    So in your case I suggest to check if your emailtemplate is selected in admin configuration in "System > Config > Customerconfiguration > Password Options" or use Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_REMIND_EMAIL_TEMPLATE, $storeId) if it is set for your store.

提交回复
热议问题