Contact Us Email Options

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












Is there a way how to set multiple recipients on Magento 2 Contacts, right now it only allows to set single email.



http://prntscr.com/l3f158



Thanks,
JM










share|improve this question























  • You have to create a separate field to achieve this functionality as this field is used in many modules so it will require you to customize at many locations. Instead, you can add a separate field for multiple email addresses.
    – Dinesh Yadav
    1 hour ago
















up vote
2
down vote

favorite












Is there a way how to set multiple recipients on Magento 2 Contacts, right now it only allows to set single email.



http://prntscr.com/l3f158



Thanks,
JM










share|improve this question























  • You have to create a separate field to achieve this functionality as this field is used in many modules so it will require you to customize at many locations. Instead, you can add a separate field for multiple email addresses.
    – Dinesh Yadav
    1 hour ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Is there a way how to set multiple recipients on Magento 2 Contacts, right now it only allows to set single email.



http://prntscr.com/l3f158



Thanks,
JM










share|improve this question















Is there a way how to set multiple recipients on Magento 2 Contacts, right now it only allows to set single email.



http://prntscr.com/l3f158



Thanks,
JM







magento2 contact-us






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 28 mins ago









shashank

5141035




5141035










asked 2 hours ago









Jm Cabugnason

613




613











  • You have to create a separate field to achieve this functionality as this field is used in many modules so it will require you to customize at many locations. Instead, you can add a separate field for multiple email addresses.
    – Dinesh Yadav
    1 hour ago
















  • You have to create a separate field to achieve this functionality as this field is used in many modules so it will require you to customize at many locations. Instead, you can add a separate field for multiple email addresses.
    – Dinesh Yadav
    1 hour ago















You have to create a separate field to achieve this functionality as this field is used in many modules so it will require you to customize at many locations. Instead, you can add a separate field for multiple email addresses.
– Dinesh Yadav
1 hour ago




You have to create a separate field to achieve this functionality as this field is used in many modules so it will require you to customize at many locations. Instead, you can add a separate field for multiple email addresses.
– Dinesh Yadav
1 hour ago










2 Answers
2






active

oldest

votes

















up vote
2
down vote













To achieve, this requirement, there are two section, where you have to work.



  • First, you have created a new field at system configuration where
    you can put multiple emails.

  • Second, you have to change MagentoContactModelMail::send behaviour base using around plugin

So, first create a module which has a system.xml file at app/code/Vendor/ModuleName/etc/adminhtml/



<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="contact">
<group id="email">
<field id="recipient_emails" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Send Emails To Multiple Email</label>
</field>
</group>
</section>
</system>
</config>


Around Plugin



<?php

namespace VendorMOdulePlugin;

use MagentoFrameworkMailTemplateTransportBuilder;
use MagentoFrameworkTranslateInlineStateInterface;
use MagentoStoreModelStoreManagerInterface;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkAppArea;

class EmailPlugin

/**
* @var MagentoFrameworkAppConfigScopeConfigInterface
*/
private $scopeConfig;

/**
* @var ConfigInterface
*/
private $contactsConfig;

/**
* @var TransportBuilder
*/
private $transportBuilder;

/**
* @var StateInterface
*/
private $inlineTranslation;

/**
* @var StoreManagerInterface
*/
private $storeManager;

/**
* Initialize dependencies.
*
* @param ConfigInterface $contactsConfig
* @param TransportBuilder $transportBuilder
* @param StateInterface $inlineTranslation
* @param StoreManagerInterface


di.xml



<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoContactModelEmail">
<plugin name="multiple-email-receipts" type="VendorModulePluginEmailPlugin" sortOrder="10" disabled="false" />
</type>
</config>


The code is not tested, give basic of the idea.






share|improve this answer





























    up vote
    0
    down vote













    Create separate config for other email address then you can create after plugin of



    emailRecipient()


    method located in



    vendor/magento/module-contact/Model/Config.php file






    share|improve this answer




















      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      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%2f245483%2fcontact-us-email-options%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote













      To achieve, this requirement, there are two section, where you have to work.



      • First, you have created a new field at system configuration where
        you can put multiple emails.

      • Second, you have to change MagentoContactModelMail::send behaviour base using around plugin

      So, first create a module which has a system.xml file at app/code/Vendor/ModuleName/etc/adminhtml/



      <?xml version="1.0" encoding="UTF-8"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
      <system>
      <section id="contact">
      <group id="email">
      <field id="recipient_emails" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
      <label>Send Emails To Multiple Email</label>
      </field>
      </group>
      </section>
      </system>
      </config>


      Around Plugin



      <?php

      namespace VendorMOdulePlugin;

      use MagentoFrameworkMailTemplateTransportBuilder;
      use MagentoFrameworkTranslateInlineStateInterface;
      use MagentoStoreModelStoreManagerInterface;
      use MagentoFrameworkAppObjectManager;
      use MagentoFrameworkAppArea;

      class EmailPlugin

      /**
      * @var MagentoFrameworkAppConfigScopeConfigInterface
      */
      private $scopeConfig;

      /**
      * @var ConfigInterface
      */
      private $contactsConfig;

      /**
      * @var TransportBuilder
      */
      private $transportBuilder;

      /**
      * @var StateInterface
      */
      private $inlineTranslation;

      /**
      * @var StoreManagerInterface
      */
      private $storeManager;

      /**
      * Initialize dependencies.
      *
      * @param ConfigInterface $contactsConfig
      * @param TransportBuilder $transportBuilder
      * @param StateInterface $inlineTranslation
      * @param StoreManagerInterface


      di.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
      <type name="MagentoContactModelEmail">
      <plugin name="multiple-email-receipts" type="VendorModulePluginEmailPlugin" sortOrder="10" disabled="false" />
      </type>
      </config>


      The code is not tested, give basic of the idea.






      share|improve this answer


























        up vote
        2
        down vote













        To achieve, this requirement, there are two section, where you have to work.



        • First, you have created a new field at system configuration where
          you can put multiple emails.

        • Second, you have to change MagentoContactModelMail::send behaviour base using around plugin

        So, first create a module which has a system.xml file at app/code/Vendor/ModuleName/etc/adminhtml/



        <?xml version="1.0" encoding="UTF-8"?>
        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
        <system>
        <section id="contact">
        <group id="email">
        <field id="recipient_emails" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
        <label>Send Emails To Multiple Email</label>
        </field>
        </group>
        </section>
        </system>
        </config>


        Around Plugin



        <?php

        namespace VendorMOdulePlugin;

        use MagentoFrameworkMailTemplateTransportBuilder;
        use MagentoFrameworkTranslateInlineStateInterface;
        use MagentoStoreModelStoreManagerInterface;
        use MagentoFrameworkAppObjectManager;
        use MagentoFrameworkAppArea;

        class EmailPlugin

        /**
        * @var MagentoFrameworkAppConfigScopeConfigInterface
        */
        private $scopeConfig;

        /**
        * @var ConfigInterface
        */
        private $contactsConfig;

        /**
        * @var TransportBuilder
        */
        private $transportBuilder;

        /**
        * @var StateInterface
        */
        private $inlineTranslation;

        /**
        * @var StoreManagerInterface
        */
        private $storeManager;

        /**
        * Initialize dependencies.
        *
        * @param ConfigInterface $contactsConfig
        * @param TransportBuilder $transportBuilder
        * @param StateInterface $inlineTranslation
        * @param StoreManagerInterface


        di.xml



        <?xml version="1.0" encoding="UTF-8"?>
        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <type name="MagentoContactModelEmail">
        <plugin name="multiple-email-receipts" type="VendorModulePluginEmailPlugin" sortOrder="10" disabled="false" />
        </type>
        </config>


        The code is not tested, give basic of the idea.






        share|improve this answer
























          up vote
          2
          down vote










          up vote
          2
          down vote









          To achieve, this requirement, there are two section, where you have to work.



          • First, you have created a new field at system configuration where
            you can put multiple emails.

          • Second, you have to change MagentoContactModelMail::send behaviour base using around plugin

          So, first create a module which has a system.xml file at app/code/Vendor/ModuleName/etc/adminhtml/



          <?xml version="1.0" encoding="UTF-8"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
          <system>
          <section id="contact">
          <group id="email">
          <field id="recipient_emails" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
          <label>Send Emails To Multiple Email</label>
          </field>
          </group>
          </section>
          </system>
          </config>


          Around Plugin



          <?php

          namespace VendorMOdulePlugin;

          use MagentoFrameworkMailTemplateTransportBuilder;
          use MagentoFrameworkTranslateInlineStateInterface;
          use MagentoStoreModelStoreManagerInterface;
          use MagentoFrameworkAppObjectManager;
          use MagentoFrameworkAppArea;

          class EmailPlugin

          /**
          * @var MagentoFrameworkAppConfigScopeConfigInterface
          */
          private $scopeConfig;

          /**
          * @var ConfigInterface
          */
          private $contactsConfig;

          /**
          * @var TransportBuilder
          */
          private $transportBuilder;

          /**
          * @var StateInterface
          */
          private $inlineTranslation;

          /**
          * @var StoreManagerInterface
          */
          private $storeManager;

          /**
          * Initialize dependencies.
          *
          * @param ConfigInterface $contactsConfig
          * @param TransportBuilder $transportBuilder
          * @param StateInterface $inlineTranslation
          * @param StoreManagerInterface


          di.xml



          <?xml version="1.0" encoding="UTF-8"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoContactModelEmail">
          <plugin name="multiple-email-receipts" type="VendorModulePluginEmailPlugin" sortOrder="10" disabled="false" />
          </type>
          </config>


          The code is not tested, give basic of the idea.






          share|improve this answer














          To achieve, this requirement, there are two section, where you have to work.



          • First, you have created a new field at system configuration where
            you can put multiple emails.

          • Second, you have to change MagentoContactModelMail::send behaviour base using around plugin

          So, first create a module which has a system.xml file at app/code/Vendor/ModuleName/etc/adminhtml/



          <?xml version="1.0" encoding="UTF-8"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
          <system>
          <section id="contact">
          <group id="email">
          <field id="recipient_emails" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
          <label>Send Emails To Multiple Email</label>
          </field>
          </group>
          </section>
          </system>
          </config>


          Around Plugin



          <?php

          namespace VendorMOdulePlugin;

          use MagentoFrameworkMailTemplateTransportBuilder;
          use MagentoFrameworkTranslateInlineStateInterface;
          use MagentoStoreModelStoreManagerInterface;
          use MagentoFrameworkAppObjectManager;
          use MagentoFrameworkAppArea;

          class EmailPlugin

          /**
          * @var MagentoFrameworkAppConfigScopeConfigInterface
          */
          private $scopeConfig;

          /**
          * @var ConfigInterface
          */
          private $contactsConfig;

          /**
          * @var TransportBuilder
          */
          private $transportBuilder;

          /**
          * @var StateInterface
          */
          private $inlineTranslation;

          /**
          * @var StoreManagerInterface
          */
          private $storeManager;

          /**
          * Initialize dependencies.
          *
          * @param ConfigInterface $contactsConfig
          * @param TransportBuilder $transportBuilder
          * @param StateInterface $inlineTranslation
          * @param StoreManagerInterface


          di.xml



          <?xml version="1.0" encoding="UTF-8"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
          <type name="MagentoContactModelEmail">
          <plugin name="multiple-email-receipts" type="VendorModulePluginEmailPlugin" sortOrder="10" disabled="false" />
          </type>
          </config>


          The code is not tested, give basic of the idea.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 29 mins ago

























          answered 1 hour ago









          Amit Bera♦

          54.7k1367160




          54.7k1367160






















              up vote
              0
              down vote













              Create separate config for other email address then you can create after plugin of



              emailRecipient()


              method located in



              vendor/magento/module-contact/Model/Config.php file






              share|improve this answer
























                up vote
                0
                down vote













                Create separate config for other email address then you can create after plugin of



                emailRecipient()


                method located in



                vendor/magento/module-contact/Model/Config.php file






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Create separate config for other email address then you can create after plugin of



                  emailRecipient()


                  method located in



                  vendor/magento/module-contact/Model/Config.php file






                  share|improve this answer












                  Create separate config for other email address then you can create after plugin of



                  emailRecipient()


                  method located in



                  vendor/magento/module-contact/Model/Config.php file







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 1 hour ago









                  Murtuza Zabuawala

                  12k62859




                  12k62859



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245483%2fcontact-us-email-options%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      One-line joke