Email notification for cancelled order

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












Hi is it also possible to get email notification for cancelled orders?



Thanks







share|improve this question


























    up vote
    2
    down vote

    favorite












    Hi is it also possible to get email notification for cancelled orders?



    Thanks







    share|improve this question






















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Hi is it also possible to get email notification for cancelled orders?



      Thanks







      share|improve this question












      Hi is it also possible to get email notification for cancelled orders?



      Thanks









      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 4 at 7:30









      RJ Tubera

      186




      186




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You can always write your own module that will do that.



          You will need few ingredients for that:




          1. Have an observer that listens on the sales_order_save_after event.



            This link explains it well



            catch order place after event magento2



            In this observer you will get the order object by
            $order= $observer->getData('order'); and you could check if the new status is canceled




          2. If condition from point 1 above is true you can proceed to send an email programatically.
            This link offers good idea of how to do that



            How to send mail programmaticlly in magento2?







          share|improve this answer




















          • Thanks for providing the links! Will check them out
            – RJ Tubera
            Sep 4 at 8:20










          • I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
            – Marjan
            Sep 4 at 8:22

















          up vote
          0
          down vote













          You will need to create a separate functionality for sending the email on order cancellation.



          You can use the order_cancel_after event for writing your email function.



          You can get the order details using the order object as given below



          <?php

          namespace VendorModuleObserver;

          use MagentoFrameworkEventObserver;
          use MagentoFrameworkEventObserverInterface;

          class OrderCancellationEmail implements MagentoFrameworkEventObserverInterface

          /**
          *
          * @param MagentoFrameworkEventObserver $observer
          * @return $this
          */
          public function execute(MagentoFrameworkEventObserver $observer)

          $order = $observer->getData('order');
          // Write your email function here







          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%2f240700%2femail-notification-for-cancelled-order%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
            3
            down vote



            accepted










            You can always write your own module that will do that.



            You will need few ingredients for that:




            1. Have an observer that listens on the sales_order_save_after event.



              This link explains it well



              catch order place after event magento2



              In this observer you will get the order object by
              $order= $observer->getData('order'); and you could check if the new status is canceled




            2. If condition from point 1 above is true you can proceed to send an email programatically.
              This link offers good idea of how to do that



              How to send mail programmaticlly in magento2?







            share|improve this answer




















            • Thanks for providing the links! Will check them out
              – RJ Tubera
              Sep 4 at 8:20










            • I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
              – Marjan
              Sep 4 at 8:22














            up vote
            3
            down vote



            accepted










            You can always write your own module that will do that.



            You will need few ingredients for that:




            1. Have an observer that listens on the sales_order_save_after event.



              This link explains it well



              catch order place after event magento2



              In this observer you will get the order object by
              $order= $observer->getData('order'); and you could check if the new status is canceled




            2. If condition from point 1 above is true you can proceed to send an email programatically.
              This link offers good idea of how to do that



              How to send mail programmaticlly in magento2?







            share|improve this answer




















            • Thanks for providing the links! Will check them out
              – RJ Tubera
              Sep 4 at 8:20










            • I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
              – Marjan
              Sep 4 at 8:22












            up vote
            3
            down vote



            accepted







            up vote
            3
            down vote



            accepted






            You can always write your own module that will do that.



            You will need few ingredients for that:




            1. Have an observer that listens on the sales_order_save_after event.



              This link explains it well



              catch order place after event magento2



              In this observer you will get the order object by
              $order= $observer->getData('order'); and you could check if the new status is canceled




            2. If condition from point 1 above is true you can proceed to send an email programatically.
              This link offers good idea of how to do that



              How to send mail programmaticlly in magento2?







            share|improve this answer












            You can always write your own module that will do that.



            You will need few ingredients for that:




            1. Have an observer that listens on the sales_order_save_after event.



              This link explains it well



              catch order place after event magento2



              In this observer you will get the order object by
              $order= $observer->getData('order'); and you could check if the new status is canceled




            2. If condition from point 1 above is true you can proceed to send an email programatically.
              This link offers good idea of how to do that



              How to send mail programmaticlly in magento2?








            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 4 at 7:57









            Marjan

            3516




            3516











            • Thanks for providing the links! Will check them out
              – RJ Tubera
              Sep 4 at 8:20










            • I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
              – Marjan
              Sep 4 at 8:22
















            • Thanks for providing the links! Will check them out
              – RJ Tubera
              Sep 4 at 8:20










            • I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
              – Marjan
              Sep 4 at 8:22















            Thanks for providing the links! Will check them out
            – RJ Tubera
            Sep 4 at 8:20




            Thanks for providing the links! Will check them out
            – RJ Tubera
            Sep 4 at 8:20












            I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
            – Marjan
            Sep 4 at 8:22




            I cannot guarantee that it will be easy to directly copy and use them. But I think it will give you a good idea. And if you somehow get stuck, well, just add a new question here :)
            – Marjan
            Sep 4 at 8:22












            up vote
            0
            down vote













            You will need to create a separate functionality for sending the email on order cancellation.



            You can use the order_cancel_after event for writing your email function.



            You can get the order details using the order object as given below



            <?php

            namespace VendorModuleObserver;

            use MagentoFrameworkEventObserver;
            use MagentoFrameworkEventObserverInterface;

            class OrderCancellationEmail implements MagentoFrameworkEventObserverInterface

            /**
            *
            * @param MagentoFrameworkEventObserver $observer
            * @return $this
            */
            public function execute(MagentoFrameworkEventObserver $observer)

            $order = $observer->getData('order');
            // Write your email function here







            share|improve this answer
























              up vote
              0
              down vote













              You will need to create a separate functionality for sending the email on order cancellation.



              You can use the order_cancel_after event for writing your email function.



              You can get the order details using the order object as given below



              <?php

              namespace VendorModuleObserver;

              use MagentoFrameworkEventObserver;
              use MagentoFrameworkEventObserverInterface;

              class OrderCancellationEmail implements MagentoFrameworkEventObserverInterface

              /**
              *
              * @param MagentoFrameworkEventObserver $observer
              * @return $this
              */
              public function execute(MagentoFrameworkEventObserver $observer)

              $order = $observer->getData('order');
              // Write your email function here







              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                You will need to create a separate functionality for sending the email on order cancellation.



                You can use the order_cancel_after event for writing your email function.



                You can get the order details using the order object as given below



                <?php

                namespace VendorModuleObserver;

                use MagentoFrameworkEventObserver;
                use MagentoFrameworkEventObserverInterface;

                class OrderCancellationEmail implements MagentoFrameworkEventObserverInterface

                /**
                *
                * @param MagentoFrameworkEventObserver $observer
                * @return $this
                */
                public function execute(MagentoFrameworkEventObserver $observer)

                $order = $observer->getData('order');
                // Write your email function here







                share|improve this answer












                You will need to create a separate functionality for sending the email on order cancellation.



                You can use the order_cancel_after event for writing your email function.



                You can get the order details using the order object as given below



                <?php

                namespace VendorModuleObserver;

                use MagentoFrameworkEventObserver;
                use MagentoFrameworkEventObserverInterface;

                class OrderCancellationEmail implements MagentoFrameworkEventObserverInterface

                /**
                *
                * @param MagentoFrameworkEventObserver $observer
                * @return $this
                */
                public function execute(MagentoFrameworkEventObserver $observer)

                $order = $observer->getData('order');
                // Write your email function here








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 4 at 7:54









                Dinesh Yadav

                3,1871730




                3,1871730



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f240700%2femail-notification-for-cancelled-order%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

                    Confectionery