Avenir | Drupal Development | Joomla Development | Magento Development | OsCommerce Development

Wednesday, 23 March 2011

How to add multiple "TO" email address contact setting in magento admin panel?


To add additional Send Email TO/CC/BCC to this section, Open app\code\core\Mage\Contacts\etc\system.xml, and find below code,
<recipient_email translate="label">
                  <label>Send Emails To</label>
                  <frontend_type>text</frontend_type>
                  <sort_order>10</sort_order>
                  <show_in_default>1</show_in_default>
                  <show_in_website>1</show_in_website>
                  <show_in_store>1</show_in_store>
  </recipient_email>
Add below code after above code in system.xml,
<recipient_email2 translate="label">
                        <label>Send Emails To</label>
                        <frontend_type>text</frontend_type>
                        <sort_order>11</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
    </recipient_email2>




· Now open app\code\core\Mage\Contacts\controllers\IndexController.php & find below code,
const XML_PATH_EMAIL_RECIPIENT = 'contacts/email/recipient_email';
Add below code after above code,
const XML_PATH_EMAIL_RECIPIENT2 = 'contacts/email/recipient_email2';
Now find below code in same file IndexController.php,
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
->setReplyTo($post['email'])
->sendTransactional( Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
null,
array('data' => $postObject)
);
Add below code after above code,
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
->setReplyTo($post['email'])
->sendTransactional( Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT2),
null,
array('data' => $postObject)
);

Now go to admin panel System --> Contacts
By Avenir Team

1 comment: