Send Order Email Programmatically Magento 2I do not want to send auto order email in magento 1.9.1.1Send Copy of Order Confirmation email programmatically in magento 2how disable automatic send mail confirmation ORDER in magento?How to send order confirmation email in magento 2 programmatically?Magento 2 - Place an order without sending emailSend order email automaticallyMagento 2 send order & invoice email manuallyLoop through order collection and send email invoiceSend cancelation order email Magento 2 Programmaticallyorder email send to multiple customer(random customer)

Is there any conditions on a finite abelian group so that it cannot be class group of any number field?

Bone Decomposition

Unix chat server making communication between terminals possible

Cine footage fron Saturn V launch's

Can I remove the doors before installing a sliding patio doors frame?

Credit card details stolen every 1-2 years. What am I doing wrong?

Did Voldemort kill his father before finding out about Horcruxes?

When to ask for constructive criticism?

How fast does a character need to move to be effectively invisible?

Link of a singularity

Will a contempt of congress lawsuit actually reach the merits?

Can a Resident Assistant Be Told to Ignore a Lawful Order?

Manually select/unselect lines before forwarding to stdout

Why is my calculation for added length of coax for a double cross antenna different to everyone else's?

Is there an English equivalent for "Les carottes sont cuites", while keeping the vegetable reference?

A scene of Jimmy diversity

Sending a photo of my bank account card to the future employer

Is there a source that says only 1/5th of the Jews will make it past the messiah?

Did 007 exist before James Bond?

What made Windows ME so crash-prone?

Is the Gritty Realism variant incompatible with dungeon-based adventures?

How should the player unlock things?

Why are road bikes (not time trial bikes) used in many triathlons?

What impact would a dragon the size of Asia have on the environment?



Send Order Email Programmatically Magento 2


I do not want to send auto order email in magento 1.9.1.1Send Copy of Order Confirmation email programmatically in magento 2how disable automatic send mail confirmation ORDER in magento?How to send order confirmation email in magento 2 programmatically?Magento 2 - Place an order without sending emailSend order email automaticallyMagento 2 send order & invoice email manuallyLoop through order collection and send email invoiceSend cancelation order email Magento 2 Programmaticallyorder email send to multiple customer(random customer)






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








0















How To send Order Email Programmatically In Magento 2.2.8










share|improve this question




























    0















    How To send Order Email Programmatically In Magento 2.2.8










    share|improve this question
























      0












      0








      0








      How To send Order Email Programmatically In Magento 2.2.8










      share|improve this question














      How To send Order Email Programmatically In Magento 2.2.8







      magento2 order-email






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 8 at 13:21









      Rk RathodRk Rathod

      2,6603 silver badges23 bronze badges




      2,6603 silver badges23 bronze badges




















          2 Answers
          2






          active

          oldest

          votes


















          2














          You can try this code:



           $email = 'example@example.com';

          $orderid = 100;

          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderid);

          $order->setCustomerEmail($email);
          if ($order)
          try
          $objectManager->create('MagentoSalesModelOrderNotifier')->notify($order);
          echo 'You sent the order email.';
          catch (MagentoFrameworkExceptionLocalizedException $e)
          echo($e->getMessage());
          catch (Exception $e)
          echo(__('We can't send the email order right now.'));
          echo($e->getMessage());







          share|improve this answer























          • Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

            – Dominic Xigen
            Jul 8 at 17:26











          • Thank you.. : )

            – Rk Rathod
            Jul 9 at 8:07


















          1














          Something like this




          use MagentoSalesModelOrderEmailSenderOrderSender;




          /**
          * @var PsrLogLoggerInterface
          */
          private $logger;
          /**
          * @var OrderSender
          */
          private $orderSender;
          /**
          * @param PsrLogLoggerInterface $logger
          * @param OrderSender $orderSender
          */
          public function __construct(
          PsrLogLoggerInterface $logger,
          OrderSender $orderSender
          )
          $this->logger = $logger;
          $this->orderSender = $orderSender;

          /**
          * @return void
          */
          public function doStuff()

          // load order however you would like
          $order = [load order logic]
          try
          $this->orderSender->send($order);
          catch (Exception $e)
          $this->logger->critical($e);








          share|improve this answer























          • 1+ for response

            – Rk Rathod
            Jul 9 at 8:06













          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%2f281224%2fsend-order-email-programmatically-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          You can try this code:



           $email = 'example@example.com';

          $orderid = 100;

          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderid);

          $order->setCustomerEmail($email);
          if ($order)
          try
          $objectManager->create('MagentoSalesModelOrderNotifier')->notify($order);
          echo 'You sent the order email.';
          catch (MagentoFrameworkExceptionLocalizedException $e)
          echo($e->getMessage());
          catch (Exception $e)
          echo(__('We can't send the email order right now.'));
          echo($e->getMessage());







          share|improve this answer























          • Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

            – Dominic Xigen
            Jul 8 at 17:26











          • Thank you.. : )

            – Rk Rathod
            Jul 9 at 8:07















          2














          You can try this code:



           $email = 'example@example.com';

          $orderid = 100;

          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderid);

          $order->setCustomerEmail($email);
          if ($order)
          try
          $objectManager->create('MagentoSalesModelOrderNotifier')->notify($order);
          echo 'You sent the order email.';
          catch (MagentoFrameworkExceptionLocalizedException $e)
          echo($e->getMessage());
          catch (Exception $e)
          echo(__('We can't send the email order right now.'));
          echo($e->getMessage());







          share|improve this answer























          • Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

            – Dominic Xigen
            Jul 8 at 17:26











          • Thank you.. : )

            – Rk Rathod
            Jul 9 at 8:07













          2












          2








          2







          You can try this code:



           $email = 'example@example.com';

          $orderid = 100;

          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderid);

          $order->setCustomerEmail($email);
          if ($order)
          try
          $objectManager->create('MagentoSalesModelOrderNotifier')->notify($order);
          echo 'You sent the order email.';
          catch (MagentoFrameworkExceptionLocalizedException $e)
          echo($e->getMessage());
          catch (Exception $e)
          echo(__('We can't send the email order right now.'));
          echo($e->getMessage());







          share|improve this answer













          You can try this code:



           $email = 'example@example.com';

          $orderid = 100;

          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $order = $objectManager->create('MagentoSalesModelOrder')->load($orderid);

          $order->setCustomerEmail($email);
          if ($order)
          try
          $objectManager->create('MagentoSalesModelOrderNotifier')->notify($order);
          echo 'You sent the order email.';
          catch (MagentoFrameworkExceptionLocalizedException $e)
          echo($e->getMessage());
          catch (Exception $e)
          echo(__('We can't send the email order right now.'));
          echo($e->getMessage());








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 8 at 13:49









          KKRKKR

          13010 bronze badges




          13010 bronze badges












          • Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

            – Dominic Xigen
            Jul 8 at 17:26











          • Thank you.. : )

            – Rk Rathod
            Jul 9 at 8:07

















          • Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

            – Dominic Xigen
            Jul 8 at 17:26











          • Thank you.. : )

            – Rk Rathod
            Jul 9 at 8:07
















          Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

          – Dominic Xigen
          Jul 8 at 17:26





          Should avoid using object manager like this devdocs.magento.com/guides/v2.3/extension-dev-guide/…

          – Dominic Xigen
          Jul 8 at 17:26













          Thank you.. : )

          – Rk Rathod
          Jul 9 at 8:07





          Thank you.. : )

          – Rk Rathod
          Jul 9 at 8:07













          1














          Something like this




          use MagentoSalesModelOrderEmailSenderOrderSender;




          /**
          * @var PsrLogLoggerInterface
          */
          private $logger;
          /**
          * @var OrderSender
          */
          private $orderSender;
          /**
          * @param PsrLogLoggerInterface $logger
          * @param OrderSender $orderSender
          */
          public function __construct(
          PsrLogLoggerInterface $logger,
          OrderSender $orderSender
          )
          $this->logger = $logger;
          $this->orderSender = $orderSender;

          /**
          * @return void
          */
          public function doStuff()

          // load order however you would like
          $order = [load order logic]
          try
          $this->orderSender->send($order);
          catch (Exception $e)
          $this->logger->critical($e);








          share|improve this answer























          • 1+ for response

            – Rk Rathod
            Jul 9 at 8:06















          1














          Something like this




          use MagentoSalesModelOrderEmailSenderOrderSender;




          /**
          * @var PsrLogLoggerInterface
          */
          private $logger;
          /**
          * @var OrderSender
          */
          private $orderSender;
          /**
          * @param PsrLogLoggerInterface $logger
          * @param OrderSender $orderSender
          */
          public function __construct(
          PsrLogLoggerInterface $logger,
          OrderSender $orderSender
          )
          $this->logger = $logger;
          $this->orderSender = $orderSender;

          /**
          * @return void
          */
          public function doStuff()

          // load order however you would like
          $order = [load order logic]
          try
          $this->orderSender->send($order);
          catch (Exception $e)
          $this->logger->critical($e);








          share|improve this answer























          • 1+ for response

            – Rk Rathod
            Jul 9 at 8:06













          1












          1








          1







          Something like this




          use MagentoSalesModelOrderEmailSenderOrderSender;




          /**
          * @var PsrLogLoggerInterface
          */
          private $logger;
          /**
          * @var OrderSender
          */
          private $orderSender;
          /**
          * @param PsrLogLoggerInterface $logger
          * @param OrderSender $orderSender
          */
          public function __construct(
          PsrLogLoggerInterface $logger,
          OrderSender $orderSender
          )
          $this->logger = $logger;
          $this->orderSender = $orderSender;

          /**
          * @return void
          */
          public function doStuff()

          // load order however you would like
          $order = [load order logic]
          try
          $this->orderSender->send($order);
          catch (Exception $e)
          $this->logger->critical($e);








          share|improve this answer













          Something like this




          use MagentoSalesModelOrderEmailSenderOrderSender;




          /**
          * @var PsrLogLoggerInterface
          */
          private $logger;
          /**
          * @var OrderSender
          */
          private $orderSender;
          /**
          * @param PsrLogLoggerInterface $logger
          * @param OrderSender $orderSender
          */
          public function __construct(
          PsrLogLoggerInterface $logger,
          OrderSender $orderSender
          )
          $this->logger = $logger;
          $this->orderSender = $orderSender;

          /**
          * @return void
          */
          public function doStuff()

          // load order however you would like
          $order = [load order logic]
          try
          $this->orderSender->send($order);
          catch (Exception $e)
          $this->logger->critical($e);









          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 8 at 13:49









          Dominic XigenDominic Xigen

          2,8501 gold badge4 silver badges16 bronze badges




          2,8501 gold badge4 silver badges16 bronze badges












          • 1+ for response

            – Rk Rathod
            Jul 9 at 8:06

















          • 1+ for response

            – Rk Rathod
            Jul 9 at 8:06
















          1+ for response

          – Rk Rathod
          Jul 9 at 8:06





          1+ for response

          – Rk Rathod
          Jul 9 at 8:06

















          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%2f281224%2fsend-order-email-programmatically-magento-2%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

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?