Accounts enrollAccount/resetPassword/verifyEmail i18n

Hi, is there a way to provide an email template for the above mentioned actions, that depends on the user’s browser language?

When creating user save their language on their profile, then on server get that value from their profile and retrieve the proper language strings from your intl files.
That is the simple overview. Application will depend on which tech you use for i10n.

Great, thanks! I’ll try that.

Hi, so I tried to use my “re-written to be thread-safe” i18n mechanism which is inherently async because it uses dynamic imports for the i18n messages (it imports messages from modules). But “Accounts.emailTemplates.enrollAccount.text” does not work with async functions.

Accounts.emailTemplates.enrollAccount.text = async (user, url) => {
  const i18n = await new I18n(user.profile.languages, "en").load();
  const accountName = user.profile.displayName || user.emails[0].address;
  return i18n.get(["EmailTemplates", "enrollAccount", "text"], { accountName, url });
};