0

I am writing a module to send alert email to customer when a product is available. I have different email template with name like "alertmail EN", "alertmail FR"...

I can't do

$this->_store->getLocaleCode()

Because the mail is send by a cron. How can I get locale code by customer?

  • If you've got locales set at store level you can't. Customers are created at website level which means they can have multiple locales. I recommend you try and work out which locale customer last ordered from and go from there. – Dominic Xigen Oct 5 at 12:19
  • I just had to load customer_address_entity and get country_id – christianFtsck Oct 7 at 12:46
  • Makes sense. Same idea as my suggestion just different approach. Yours will be more efficient as more likely to have multiple orders but single address. – Dominic Xigen Oct 7 at 12:50

Your Answer

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

Browse other questions tagged or ask your own question.