Send copy of contact us form with checkbox












0















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?










share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    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?










    share|improve this question
















    bumped to the homepage by Community 8 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      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?










      share|improve this question
















      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?







      magento-1.7 forms send-mail






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 29 '15 at 14:12









      Amit Bera

      57.4k1474171




      57.4k1474171










      asked Mar 29 '15 at 13:14









      JohnJohn

      52111




      52111





      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          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'))
          ->setReplyTo($post['email'])
          <!-- add this -->
          ->addBcc($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)
          );





          share|improve this answer


























          • 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
            Mar 29 '15 at 14:59













          • yes. this can do this bcc

            – Amit Bera
            Mar 29 '15 at 15:00













          • I have added the line, but no e-mail is being sent unfortunately.

            – John
            Mar 29 '15 at 18:42











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f62282%2fsend-copy-of-contact-us-form-with-checkbox%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          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'))
          ->setReplyTo($post['email'])
          <!-- add this -->
          ->addBcc($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)
          );





          share|improve this answer


























          • 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
            Mar 29 '15 at 14:59













          • yes. this can do this bcc

            – Amit Bera
            Mar 29 '15 at 15:00













          • I have added the line, but no e-mail is being sent unfortunately.

            – John
            Mar 29 '15 at 18:42
















          0














          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'))
          ->setReplyTo($post['email'])
          <!-- add this -->
          ->addBcc($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)
          );





          share|improve this answer


























          • 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
            Mar 29 '15 at 14:59













          • yes. this can do this bcc

            – Amit Bera
            Mar 29 '15 at 15:00













          • I have added the line, but no e-mail is being sent unfortunately.

            – John
            Mar 29 '15 at 18:42














          0












          0








          0







          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'))
          ->setReplyTo($post['email'])
          <!-- add this -->
          ->addBcc($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)
          );





          share|improve this answer















          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'))
          ->setReplyTo($post['email'])
          <!-- add this -->
          ->addBcc($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)
          );






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 29 '15 at 14:59

























          answered Mar 29 '15 at 14:46









          Amit BeraAmit Bera

          57.4k1474171




          57.4k1474171













          • 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
            Mar 29 '15 at 14:59













          • yes. this can do this bcc

            – Amit Bera
            Mar 29 '15 at 15:00













          • I have added the line, but no e-mail is being sent unfortunately.

            – John
            Mar 29 '15 at 18:42



















          • 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
            Mar 29 '15 at 14:59













          • yes. this can do this bcc

            – Amit Bera
            Mar 29 '15 at 15:00













          • I have added the line, but no e-mail is being sent unfortunately.

            – John
            Mar 29 '15 at 18:42

















          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
          Mar 29 '15 at 14:59







          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
          Mar 29 '15 at 14:59















          yes. this can do this bcc

          – Amit Bera
          Mar 29 '15 at 15:00







          yes. this can do this bcc

          – Amit Bera
          Mar 29 '15 at 15:00















          I have added the line, but no e-mail is being sent unfortunately.

          – John
          Mar 29 '15 at 18:42





          I have added the line, but no e-mail is being sent unfortunately.

          – John
          Mar 29 '15 at 18:42


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f62282%2fsend-copy-of-contact-us-form-with-checkbox%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Polycentropodidae

          Magento 2 Error message: Invalid state change requested

          Paulmy