How to add CC or BCC to Magento Contact form?
My client was requested to add a cc & bcc to contact form.Can anyone help me?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
$storeId=Mage::app()->getStore()->getId();
//Multiple BCC email address
$add_bcc=array("user1@gmail.com","user2@gmail.com");
//Multiple CC email address
$add_cc=array("user3@gmail.com","user4@gmail.com");
$email='mail@domain.com';
$sender = Array('name' => 'test','email' => 'test@domain.com');
$mailSubject='Your subject here';
$vars = Array('name' => 'Your message');
$translate=Mage::getModel('core/email_template');
$translate->getMail()->addCc($add_cc);
$translate->setTemplateSubject($mailSubject)
->addBCC($add_bcc)
->sendTransactional($templateId, $sender, $email, null, $vars, $storeId);
$translate->setTranslateInline(true);