Managing Multiple Email Addresses for Customers

customeremailsales-order

I've been searching high and low but I can't seem to find any information on this. My client would like the ability of multiple email addresses to a customer, so that all sales emails would be sent out to a possible 2+ email addresses.

I know about customer fields, its the email side I"m a bit wary of.

Has any one got experience with this or have any suggestion on how to approach this?

Thanks

Best Answer

You say that the customer fields part you know.
This is a good start.
You should create an other customer attribute called 'secondary_email'. Make it mandatory if needed.

After that you have to change all the methods that send e-mails to customers and make them send and e-mail to the second address also.
Let's take for example Mage_Sales_Model_Order::sendNewOrderEmail().

There is this line that sets the e-mail address and name for the customer to the e-mail.

$emailInfo->addTo($this->getCustomerEmail(), $customerName);

You need after that this:

if ($this->getCustomer() && $this->getCustomer()->getSecondaryEmail()) {
    $emailInfo->addTo($this->getCustomer()->getSecondaryEmail(), $customerName);
}
Related Topic