How to send email to multiple recipients in magento


$postData['offemail'] = 'sendermail@gmail.com';
$templateId = 1;
$recipients = Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT);
$recipients = explode(',' , $recipients);
array_push($recipients,$postData['offemail']);
$store = Mage::app()->getStore();
$translate = Mage::getSingleton('core/translate');
Mage::getModel('core/email_template')
->sendTransactional($templateId,
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
array_values($recipients),
'Recipient Name',
array('data' => $postObject),
$store->getId()
);
$translate->setTranslateInline(true);

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s