1

One Magento Installation
Two websites on subdomains
sub1.xxxxxxx.com
sub2.xxxxxxx.com

Customer1 subscribes to sub1.xxxxxxx.com.
Email address is in database and customer can login with the same credentials to sub2.xxxxxxx.com.

In Store Email Addresses, sender email address are different in each website for “CustomerSupport” sender name. eg sub1@xxxxxxx.com and sub2@xxxxxxx.com

When Customer1 tries to login to sub2.xxxxxxx.com and forget his password, Password Reset Confirmation email is coming from sub1@xxxxxxx.com instead of sub2@xxxxxxx.com and mail comes in spam folder.

Any suggestions ?

1

I can explain why this happens, but I don't have a full solution.
The password reminder e-mail is send through this method from the customer model

public function sendPasswordReminderEmail()
{
    $storeId = $this->getStoreId();
    if (!$storeId) {
        $storeId = $this->_getWebsiteStoreId();
    }

    $this->_sendEmailTemplate(self::XML_PATH_REMIND_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY,
        array('customer' => $this), $storeId);

    return $this;
}

What's important here is the $storeId variable.
it is determined like this:
If the customer is associated to a store view other than the admin then that store id is used.
So if you have 2 store views and the customer registered in store 1, then this e-mail will be received from store 1 even if he requests a new password from the second one.

If the customer is associated to the admin store then _getWebsiteStoreId will identify the default Store and use that one.

So what you can do here is to try to modify the method mentioned above and replace

$storeId = $this->getStoreId();

with

$storeId = Mage::app()->getStore()->getId(); //get current store
if (!$storeId) { //if one admin store use the customer's prefered store
     $storeId = $this->getStoreId();
}

I'm not sure this will work or the side effects it has, but you can give it a try.

2
  • I replaced code as above in code/local/Mage/Customer/Model/customer.php and still have the same result @Marius – user2225406 Dec 18 '14 at 11:42
  • I thought it might now work. You can at least start to debug from the code I mentioned – Marius Dec 18 '14 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.