Вопрос

How can we stop new order confirmation email.

We have 3 payment methods which are EFT(Cash on Delivery), Paypal express checkout & Credit card payment. So when we place an order we get invoice and order confirmation email, so our requirement is something like we don't want order confirmation email if Paypal express checkout is used to order otherwise we want them so can't disable it from admin config and want some custom solution about it, any help will be appreciated, Thanks.

Это было полезно?

Решение

You can either create around plugin or preference for the "send" function available in this file

vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php

You can put your respective business logic in this function to restrict sending order confirmation emails in specific cases.

Hope this help you.

Thanks,

Другие советы

simply Override Magento\Sales\Model\Order\Email\Sender.php

 if($order->getPayment()->getMethodInstance()->getCode() != "yourpaymentmethodcode"){
        $sender->send();
 }
 if($order->getPayment()->getMethodInstance()->getCode() != "yourpaymentmethodcode"){
        $sender->sendCopyTo();
 }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top