Hello, developer!
In case you need to send custom emails in different languages and increase your engagement, you can do this by following this article. We are going to use this module for this guide.
To make it possible, you must have a column called "localeIdentifier" in your "User" class.
Well, the first thing you must do is to install an NPM Module in your cloud code, as described below:
{
"dependencies": {
"parse-server-email-adapter-multiple-languages": "*"
}
}
Once it's done, deploy a new .JSON file (like "locale.json", for example) inside your "cloud" folder in your cloud code.
Inside this file, you must follow this structure to make it work:
{
"pt_BR":{
"verificationSubject": "[*|appname|*] | Verifique o seu e-mail",
"verificationBody": "Olá *|username|*, \n\nVocê está sendo solicitado a confirmar o endereço de e-mail *|email|* para *|appname|*\n\nClique aqui para confirmar: \n *|link|*",
"passwordResetSubject": "[*|appname|*] | Alterar sua senha",
"passwordResetBody":"Olá,\n\nVocê requisitou uma alteração de senha para *|appname|*.\n\nClique aqui para altear:\n*|link|*"
},
"en_US":{
"verificationSubject": "Please verify your e-mail for *|appname|*",
"verificationBody": "Hi *|username|*,\n\nYou are being asked to confirm the e-mail address *|email|* with *|appname|*\n\nClick here to confirm it:\n*|link|*",
"passwordResetSubject": "Password Reset Request for *|appname|*",
"passwordResetBody":"Hi *|username|*,\n\nYou requested a password reset for *|appname|*.\n\nClick here to reset it:\n*|link|*"
}
}
The default language is "en_US", so, just set it in case you wish to overwrite the default message set on the module. In this example, we have also set for a different language "pt_BR", but you can set it for different regions, without any trouble.
Please check our Help Center or contact us at the Online Chat for further help.
Comments
0 comments
Please sign in to leave a comment.