I tried to disable magento 2 send email order and invoice automatically (after place an order and invoice an order) by disable send email in configration Store > Configuration > Sales > Sales Emails. But when i tried to send manually by clicking send email button or do it programmatically it won't send the email, unless i enable send order email in configuration again.

enter image description here


$order = $objectManager->create('\Magento\Sales\Model\Order')

1 Answer 1


This is intended behavior. If you disable the order e-mails under Configuration -> Sales Emails then no new order e-mails will get send. Not only from simply placing an order, but it's also disabled when you try to manually send the e-mail.

In case of an order this behavior comes from the send method in Magento\Sales\Model\Order\Email\Sender\OrderSender. (For invoices this is Magento\Sales\Model\Order\Email\Sender\InvoiceSender)

You could modify this behavior with your own plugin if you so desire.


How you do this is entirely dependant on your specific needs. But one example could be to make a custom model that extends the OrderSender and skips the check for the configuration setting:



namespace Vendor\Myplugin\Model\Order;

use Magento\Sales\Model\Order;

class CustomOrderSender extends \Magento\Sales\Model\Order\Email\Sender\OrderSender

    protected function checkAndSend(Order $order)

        /** @var SenderBuilder $sender */
        $sender = $this->getSender();

        try {
        } catch (\Exception $e) {

        return true;

Then in your controller / custom method / wherever, you would include this model instead of the default option.


public function __construct(
    \Vendor\Myplugin\Model\Order\CustomOrderSender $customOrderSender,
    \Magento\Sales\Api\OrderRepositoryInterface $orderRepositoryInterface,
) {
    $this->customOrderSender = $customOrderSender;
    $this->orderRepositoryInterface = $orderRepositoryInterface;

public function send() {
    $order = $this->orderRepositoryInterface->get(<order_id>);
  • can you give an example? Jul 6, 2018 at 7:37
  • That entirely depends on your needs. I've added one such example to my answer.
    – sduif
    Jul 6, 2018 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.