Magento “Forgot Password” email sent in wrong language

emailforgot-passwordmagentomagento-1.7multilingual

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 sent in the correct language EXCEPT for the "Forgot Password" e-mail which is always sent in German. Here's what I did:

  • Installed language packs and made sure all templates and folder structures are correct. Example: /app/locale/nl_NL/template/email/
  • Under System » Transactional Emails: I applied the template, chose the locale and saved.
  • Then I went to System » Configuration » Sales Emails, I switched to each language from the "Current Configuration Scope" dropdown, and I chose the templates I created in Transactional Emails for each language (each store view).

After looking around online for a solution, it seems others had this problem too and someone mentioned that Magento is picking the "Forgot Password" template from the first locale folder found in /app/locale/. In my case I had: de_DE, en_US, fr_FR, nl_NL. So It picks the template from the German de_DE pack.

NOTE: Also, in the backend under "Configuration" there's a tab on the left called "LOCALE PACKS" which only has "Locale de_DE" under it, even though I have other language packs which don't show up here. Not sure if this is relevant.

Site: http://site1.cp1.glimworm.com/magento/

Magento Community version: 1.7.0.2

Locale packs:

  • Mage_Locale_en_US
  • Locale_Mage_community_de_DE
  • Locale_Mage_community_fr_FR
  • Mage_Locale_nl_NL

Any idea how I can get the correct email template from the corresponding language to be sent as opposed to always German? Any help will be greatly appreciated! I can provide more info as well.

Best Answer

I have same problem in magento v1.5. After a long research i found this solution and its working for me.

Mage/Customer/Model/Customer.php

in this file i have make some changes as following.
find this line of code
if (!$storeId) 
{
    $storeId = $this->_getWebsiteStoreId($this->getSendemailStoreId());
}

and replace with

$storeId = ($storeId == '0')?$this->getSendemailStoreId():$storeId;
if ($this->getWebsiteId() != '0' && $storeId == '0') 
{
    $storeIds = Mage::app()->getWebsite($this->getWebsiteId())->getStoreIds();
    reset($storeIds);
    $storeId = current($storeIds);
}
Related Topic