Question

I'm trying to create a Dutch translation for the Password Reset Confirmation E-mail.

What i've tried so far:

In the Magento folder structure, there is a directory holding all dutch e-mail translations: /app/locale/nl_NL/template/email/ however all my attempts to create a simular template for the Password Reset Confirmation E-mail are unsuccesvol.

ftp screenshot

Has anyone been able to make this work, perhaps for another language? Can someone please set me in the right direction?

Was it helpful?

Solution

You have to copy /app/locale/en_US/template/email/account_password_reset_confirmation.html to your nl_NL folder and translate it.

You also can create a template in the admin backend.

OTHER TIPS

I think this is a bug in the Mage_Customer module.

In Mage_Customer_Model_Customer::sendPasswordResetConfirmationEmail, the email is sent in the locale of the store that is associated to the customer instance by calling $this->getStoreId(). When the store is not set, the default store for the website to which the customer is associated is used.

In Mage_Customer_AccountController::forgotPasswordPostAction (the one place where this method is used), a customer instance is created based on the supplied email, but the store is never set on this instance. This means that email is sent to the default store of the website to which to customer instance is associated.

To resolve this, add the following line just before the call to sendPasswordResetConfirmationEmail:

$customer->setStoreId(Mage::app()->getStore()->getId());

When you put this in an override of the original Mage_Customer_AccountController, the method looks like this (Magento CE 1.9.0.1):

/**
 * Forgot customer password action
 */
public function forgotPasswordPostAction()
{
    $email = (string) $this->getRequest()->getPost('email');
    if ($email) {
        if (!Zend_Validate::is($email, 'EmailAddress')) {
            $this->_getSession()->setForgottenEmail($email);
            $this->_getSession()->addError($this->__('Invalid email address.'));
            $this->_redirect('*/*/forgotpassword');
            return;
        }

        /** @var $customer Mage_Customer_Model_Customer */
        $customer = $this->_getModel('customer/customer')
            ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
            ->loadByEmail($email);

        if ($customer->getId()) {
            try {
                $newResetPasswordLinkToken =  $this->_getHelper('customer')->generateResetPasswordLinkToken();
                $customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
                //START Set store id to fix email locale
                $customer->setStoreId(Mage::app()->getStore()->getId());
                //END Set store id to fix email locale
                $customer->sendPasswordResetConfirmationEmail();
            } catch (Exception $exception) {
                $this->_getSession()->addError($exception->getMessage());
                $this->_redirect('*/*/forgotpassword');
                return;
            }
        }
        $this->_getSession()
            ->addSuccess( $this->_getHelper('customer')
            ->__('If there is an account associated with %s you will receive an email with a link to reset your password.',
                $this->_getHelper('customer')->escapeHtml($email)));
        $this->_redirect('*/*/');
        return;
    } else {
        $this->_getSession()->addError($this->__('Please enter your email.'));
        $this->_redirect('*/*/forgotpassword');
        return;
    }
}

Even if we create a new transaction email for PASSWORD RESET in the backend, there is no option to set the PASSWORD reset to that new file.

How do you do it ? I dont see any option for new registration and password reset options changing.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top