Disable email notification for specific customers Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Get order entity inside invoice emailMagento 2 : Is there any way to disable Welcome Email after signupMagento 2: How to Send Reset Password Mass Email to Customers ProgrammaticallyMagento 2: Disable “Cash on delivery” for downloadable productsMagento 2 - Is there any way to disable Welcome Email after signup for specific store or websiteMagento 2 disable checkout for certain customersWelcome Email 1.9 disable sending this emailMagento 2 validate customer session with extra parametersHaving problems with Magento 2.2.4 outgoing email to customersShowing email in “Shipping Address”

Why didn't this character "real die" when they blew their stack out in Altered Carbon?

Is it fair for a professor to grade us on the possession of past papers?

Can a USB port passively 'listen only'?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

How to deal with a team lead who never gives me credit?

Dating a Former Employee

How does the particle を relate to the verb 行く in the structure「A を + B に行く」?

2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?

In predicate logic, does existential quantification (∃) include universal quantification (∀), i.e. can 'some' imply 'all'?

Why light coming from distant stars is not discreet?

Sci-Fi book where patients in a coma ward all live in a subconscious world linked together

Do I really need recursive chmod to restrict access to a folder?

3 doors, three guards, one stone

How widely used is the term Treppenwitz? Is it something that most Germans know?

What's the meaning of 間時肆拾貳 at a car parking sign

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

Why did the IBM 650 use bi-quinary?

Identifying polygons that intersect with another layer using QGIS?

How to tell that you are a giant?

How to align text above triangle figure

Why is my conclusion inconsistent with the van't Hoff equation?

Can a non-EU citizen traveling with me come with me through the EU passport line?

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

51k Euros annually for a family of 4 in Berlin: Is it enough?



Disable email notification for specific customers



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Get order entity inside invoice emailMagento 2 : Is there any way to disable Welcome Email after signupMagento 2: How to Send Reset Password Mass Email to Customers ProgrammaticallyMagento 2: Disable “Cash on delivery” for downloadable productsMagento 2 - Is there any way to disable Welcome Email after signup for specific store or websiteMagento 2 disable checkout for certain customersWelcome Email 1.9 disable sending this emailMagento 2 validate customer session with extra parametersHaving problems with Magento 2.2.4 outgoing email to customersShowing email in “Shipping Address”



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








2















Please can any one help me on this,
I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()



but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?










share|improve this question






























    2















    Please can any one help me on this,
    I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
    I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()



    but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?










    share|improve this question


























      2












      2








      2








      Please can any one help me on this,
      I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
      I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()



      but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?










      share|improve this question
















      Please can any one help me on this,
      I would like to disable email notofication for customers, which have a flag non_email_customers set to true.
      I Have Try this way. i have created a plugin for: MagentoFrameworkMailsendTransportInterface::sendMessage()



      but I don't know how to get customer object there. Getting it from customer session is not the best solution I suppose beacuse of mail from adminhtml area. Any ideas how to resolve this issue?







      magento2 email magento2.3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 12 at 23:49









      Magento_Bhurio

      435112




      435112










      asked Apr 12 at 17:47









      Wojciech KaWojciech Ka

      15514




      15514




















          1 Answer
          1






          active

          oldest

          votes


















          1














          You can get a list of all the customers with this code -



          public function __construct(
          ...
          MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
          ...
          )
          ...
          $this->_customerFactory = $customerFactory;
          ...


          /**
          * Get customer collection
          */
          public function getCustomerCollection()

          return $this->_customerFactory->create();



          Use this as -



          $customerCollection = $this->getCustomerCollection();

          foreach ($customerCollection as $customer)
          echo $customer->getEmail(); //Or any other method



          Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');



          To get a list of all the methods available on the $customer object, use get_class_methods($customer)



          Hope this helps!






          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',
            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%2f269935%2fdisable-email-notification-for-specific-customers%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









            1














            You can get a list of all the customers with this code -



            public function __construct(
            ...
            MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
            ...
            )
            ...
            $this->_customerFactory = $customerFactory;
            ...


            /**
            * Get customer collection
            */
            public function getCustomerCollection()

            return $this->_customerFactory->create();



            Use this as -



            $customerCollection = $this->getCustomerCollection();

            foreach ($customerCollection as $customer)
            echo $customer->getEmail(); //Or any other method



            Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');



            To get a list of all the methods available on the $customer object, use get_class_methods($customer)



            Hope this helps!






            share|improve this answer



























              1














              You can get a list of all the customers with this code -



              public function __construct(
              ...
              MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
              ...
              )
              ...
              $this->_customerFactory = $customerFactory;
              ...


              /**
              * Get customer collection
              */
              public function getCustomerCollection()

              return $this->_customerFactory->create();



              Use this as -



              $customerCollection = $this->getCustomerCollection();

              foreach ($customerCollection as $customer)
              echo $customer->getEmail(); //Or any other method



              Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');



              To get a list of all the methods available on the $customer object, use get_class_methods($customer)



              Hope this helps!






              share|improve this answer

























                1












                1








                1







                You can get a list of all the customers with this code -



                public function __construct(
                ...
                MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
                ...
                )
                ...
                $this->_customerFactory = $customerFactory;
                ...


                /**
                * Get customer collection
                */
                public function getCustomerCollection()

                return $this->_customerFactory->create();



                Use this as -



                $customerCollection = $this->getCustomerCollection();

                foreach ($customerCollection as $customer)
                echo $customer->getEmail(); //Or any other method



                Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');



                To get a list of all the methods available on the $customer object, use get_class_methods($customer)



                Hope this helps!






                share|improve this answer













                You can get a list of all the customers with this code -



                public function __construct(
                ...
                MagentoCustomerModelResourceModelCustomerCollectionFactory $customerFactory
                ...
                )
                ...
                $this->_customerFactory = $customerFactory;
                ...


                /**
                * Get customer collection
                */
                public function getCustomerCollection()

                return $this->_customerFactory->create();



                Use this as -



                $customerCollection = $this->getCustomerCollection();

                foreach ($customerCollection as $customer)
                echo $customer->getEmail(); //Or any other method



                Since non_email_customers sounds like a user defined field, you should be able to access it as $customer->getDataByKey('non_email_customers');



                To get a list of all the methods available on the $customer object, use get_class_methods($customer)



                Hope this helps!







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 13 at 0:50









                coderGeekcoderGeek

                367




                367



























                    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%2f269935%2fdisable-email-notification-for-specific-customers%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

                    Sum ergo cogito? 1 nng

                    三茅街道4182Guuntc Dn precexpngmageondP