reactioncommerce / reaction-feature-requests

Reaction Feature Requests
13 stars 1 forks source link

Support multilingual emails based on accounts preferred language #63

Open jmaver-plume opened 5 years ago

jmaver-plume commented 5 years ago

It would be beneficial if emails received would be based on account language preference, rather than having same language for all emails for the shop.

Currently when an email is the template and subject are got with Reaction.Email.getTemplate(tpl) and Reaction.Email.getSubject(tpl). In those functions language gained by calling Reaction.getShopLanguage() which is language of the shop. Then they call Templates.findOne({ name: template, language });. This means all accounts will receive the same language emails (language of the shop).

My proposed solution would be to extend Account profile schema to add language field and then Reaction.Email.getTemplate and Reaction.Email.getSubject accept an additional parameter language.

jmaver-plume commented 5 years ago

The following is my proposed solution which uses develop branch as base branch.