cancel
Showing results for 
Search instead for 
Did you mean: 

How can I disable Magento 2 transaction emails only for customers based in specific locations?

How can I disable Magento 2 transaction emails only for customers based in specific locations?

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!

6 REPLIES 6

Re: How can I disable Magento 2 transaction emails only for customers based in specific locations?

Hello @rivki_stoll

 

how can you identify which email id from which location?

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: How can I disable Magento 2 transaction emails only for customers based in specific locations?

Hi,

 

Thanks for your reply.

Possibly based on the order billing/shipping info.

 

 

Re: How can I disable Magento 2 transaction emails only for customers based in specific locations?

Hello @rivki_stoll

 

 

do you just want to for order email ? or all email?

 

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: How can I disable Magento 2 transaction emails only for customers based in specific locations?

@Sunil Patel only for the order emails. 

Re: How can I disable Magento 2 transaction emails only for customers based in specific locations?

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


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: How can I disable Magento 2 transaction emails only for customers based in specific locations?

@Sunil Patel thanks! I will let you know.