문제

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