I am using Magento's contact us form, which, at the moment, doesn't send a copy of the contact us form to the customer who is filling the form in.

I want to control this with a checkbox, therefore i have added a checkbox to the form.phtml page:

<input type="checkbox" name="sendcopy" value="Yes" checked/>

How can i configure the send e-mail function so that it sends out a copy (to the e-mail address which is filled in, in the e-mail field of the contact form) of the e-mail when the checkbox is checked, and doesn't send a copy when it is not checked?

2 Answers 2


You can do this by using bcc function addBcc($post['email]) after -setReplyTo($post['email']) at class Mage_Contacts_IndexController of function postAction().

$mailTemplate = Mage::getModel('core/email_template');
/* @var $mailTemplate Mage_Core_Model_Email_Template */
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
    <!-- add this -->
    array('data' => $postObject)
  • Thanks, i understand this part will send the e-mail as BCC to the sender. How can i build in the check, that this function will only be active when the checkbox is checked?
    – John
    Commented Mar 29, 2015 at 14:59
  • yes. this can do this bcc
    – Amit Bera
    Commented Mar 29, 2015 at 15:00
  • I have added the line, but no e-mail is being sent unfortunately.
    – John
    Commented Mar 29, 2015 at 18:42

I would not recommend this. What's to stop a bot filling out spam content, someone else's email, ticking the box and turning your magento store into a spam server.

If you do decide to do this make sure you have captcha on the form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.