How I can disable Magento 2 transaction emails only for customers based in specific locations?
ie: we only want UK based customers receive automatic transaction emails.
Thanks!
Hello @rivki_stoll
how can you identify which email id from which location?
Hi,
Thanks for your reply.
Possibly based on the order billing/shipping info.
Hello @rivki_stoll
do you just want to for order email ? or all email?
@Sunil Patel only for the order emails.
Hello @rivki_stoll
magento/module-quote/Model/QuoteManagement.php
protected function submitQuote(QuoteEntity $quote, $orderData = []) { ................. ............ // your logic $order->setBillingAddress($billingAddress); $order->setCanSendNewEmailFlag(false); // email logic ..................... }
hope it will help you.
if works then mark as solution
@Sunil Patel thanks! I will let you know.