RE: 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?

arjun Team Leader Asked on July 4, 2018 in MAGENTO.
Add Comment
1 Answers

 

$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);

 

Team Leader Answered on July 6, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.