Multilingual Email Templates

#1

is there any way to support multilingual in email temp for email verification and reset password

#2

You can use the e-email template to check a “language” field in your User collection and return texts according to that language. But it really depends on the adapter you are using. What’s the parse mail adapter that you are using?

#3

i used custom mail adapter the below one for the testing only
https://gist.github.com/WahdanZ/7bbb81da0077d27e18afe36ab0b59ecd
but what’s the recommend mail adapter the will be useful in this case ?

#4

Since you are using a custom e-mail adapter, I think it will be really easy for you to choose a different template depending on the user language.

You can also find here a list of the community adapters (https://github.com/parse-community/parse-server/#email-verification-and-password-reset). I haven’t check all of them, but I know that mailgun adapter, for example, allows you to specify your e-mail template using mustache, so you’d also be able to change the texts depending on the user’s language.

1 Like
#5

Thanks for you quick replay, but how can i detect the user lang , it’ll be done from the front end side will user register, i need to add new column for the user language.

#6

Both Parse iOS and Android SDKs automatically make a field called localeIdentifier available at current installation. You can associate the user to an installation and read from installation collection when sending the e-mail, or you can also add a new localeIdentifier field in the user collection and duplicate this information there.

1 Like
#7

Hello,

You can see how we are doing it https://blog.sashido.io/multilingual-email-templates-and-user-facing-pages/

It’a pretty parse like way with a bit cloudcode in your app for the user-facing pages. The code is in the article so feel free to reuse it :slight_smile:

1 Like