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

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

July 18, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - send forgot password email in the customer's language

Fixing Magento Forgot Password Email Language Issues: A Comprehensive Guide

Managing language settings in Magento can sometimes lead to unexpected behavior, especially when it comes to sending forgotten password emails from the backend. In this article, we’ll delve into a common issue faced by many Magento store owners and provide a step-by-step solution to ensure your customers receive their password reset emails in the correct language.

Understanding the Problem: Why Emails Are Sent in the Wrong Language

The discrepancy you’re experiencing is likely due to the default behavior of Magento’s built-in Mage_Core_Model_Email_Template class. When sending an email from the backend, Magento uses the system-wide language setting rather than the language associated with the specific customer record.

For instance, if your store is set up to display in English by default but a customer has their account set to Spanish, you might end up sending them a password reset email in English when you manually trigger it from the admin panel. However, when the customer requests a new password from the frontend, Magento correctly uses the customer’s preferred language.

Resolving the Issue: Sending Password Reset Emails in the Correct Language

To fix this issue and ensure your customers always receive their reset emails in their chosen language, you’ll need to modify the core email template model. Here’s how:

  1. Override the Core Model: The first step is to create a custom extension that extends Mage_Core_Model_Email_Template. This will allow us to override its behavior without modifying the core files directly.

  2. Update the Email Template Send Method: In your new model class, find the send method and modify it as follows:

public function send($emailInfo)
{
    // Get the customer's language code
    $customerId = Mage::getSingleton('core/session')->getCustomerId();
    if ($customerId) {
        $customer = Mage::getModel('customer/customer')->load($customerId);
        $languageCode = $customer->getData('group_id');
    } else {
        // If no customer session is active, fall back to the store's default language
        $storeId = Mage::app()->getStore()->getId();
        $languageCode = Mage::getModel('core/locale')->getLocale($storeId)->getLocaleCode();
    }

    // Set the email template to use the customer's preferred language
    $this->setTemplateId(Mage::getSingleton('customer/customer')->getEmailTemplate($emailInfo['type'])->getId());
    $this->setSenderName($emailInfo['sender_name']);
    $this->setSenderEmail($emailInfo['sender_email']);

    // Set the email template variables
    foreach ($emailInfo['template_variables'] as $key => $value) {
        $this->setTemplateVars($key, $value);
    }

    // Set the email template design
    if (isset($emailInfo['design'])) {
        $this->setDesignConfig($emailInfo['design']);
    }

    // Send the email
    return parent::send();
}

This code first attempts to retrieve the customer’s language preference from their session. If a customer is logged in, it uses their preferred language; if not, it defaults to the store’s default language setting.

  1. Configure Your Extension: Configure your extension to use this new model class by updating your config.xml file:
<config>
    <modules>
        <Your_Extension_Name>
            <version>1.0.0</version>
        </Your_Extension_Name>
    </modules>

    <global>
        <models>
            <your_extension_name>
                <class>Your_Extension_Name_Model</class>
            </your_extension_name>
            <resourceAdapter>
                <arguments>
                    <model>your_extension_name/resource_model</model>
                </arguments>
            </resourceAdapter>
        </models>

        <helpers>
            <your_extension_name>
                <class>Your_Extension_Name_Helper</class>
            </your_extension_name>
        </helpers>
    </global>
</config>
  1. Flush Magento Cache: Don’t forget to flush your Magento cache after making these changes to ensure the new model is loaded.

Conclusion

Sending password reset emails in the correct language from the backend requires a bit of customization, but it’s achievable with a thorough understanding of Magento’s core email template model.

By following this guide and overriding the Mage_Core_Model_Email_Template class, you can ensure your customers always receive their password reset instructions in their preferred language – regardless of whether they initiate the request from the frontend or if an administrator triggers it manually from the backend.

Remember to keep your Magento version up-to-date for optimal performance and security. If you’re looking for professional Magento development services or need assistance with other aspects of your e-commerce platform, don’t hesitate to reach out to our team at Laravel Company.

Happy coding!

Themes Admin Configuration Email

Our network