Frontegg uses HTML and standard handlebars and hence, supports {{if}}
and {{else}}
statements inside the templates.
Store user's language on user metadata
You can set user's metadata either from the [YOUR_ENV] ➜ Backoffice ➜ Users ➜ User's metadata with for example:
{"en": false, "he": true}
On the email template itself, you can wrap the template as below:
{{#if metadata.en}}
English template
{{else}}
Hebrew template
{{/if}}
Another option is to save the strings that need to be translated on the user's metadata as well and use only translated strings inside the emails instead of full templates.
NOTE:
It is not possible to translate Email Subjects at this time, please reach out to us to get updates when this ability is added.
For more details on conditional emails, we recommend following the official handlebars documentation.