Support multiple languages for email template
Multi-language email templates allow you to send end users email messages in multiple languages. Safewhere Identify tries to pick a template of a language based on the first preferred language of your web browser. For instance, if you set "da" as the first preferred language of your browser and you requesting for a reset password link sent to you via email, you will receive an email in Danish.
Tip: You can test sending an email out in a specific language by selecting a template in that language and clicking on the TEST button.
The following example demonstrates how the multi-languages email templates data is stored in the database. REST API for the email template uses the same XML structure.
<?xml version="1.0" encoding="utf-8"?>
<mails name="ResetUserPassword">
<mail lang="">
<from>noreply@safewhere.com</from>
<to><![CDATA[<%=sendToMail%>]]></to>
<bcc></bcc>
<cc></cc>
<encoding>text</encoding>
<bodyIsHtml>true</bodyIsHtml>
<sendAsync>false</sendAsync>
<body><![CDATA[Dear <%=userName%>,
<br /><br />
Your password has been reset.
<br /><br />
Your new password is <b><%=password%></b>
<br /><br />
With best regards, Safewhere Identify.
<br /><br />
Notice! This is an auto-generated email please do not reply.]]></body>
<subject><![CDATA[Safewhere Identify - password has been reset]]></subject>
</mail>
<mail lang="DA">
<from>noreply@safewhere.com</from>
<to><![CDATA[<%=sendToMail%>]]></to>
<bcc></bcc>
<cc></cc>
<encoding>text</encoding>
<bodyIsHtml>true</bodyIsHtml>
<sendAsync>false</sendAsync>
<body><![CDATA[Kære <% = brugernavn%>,
<br /> <br />
Din adgangskode er nulstillet.
<br /> <br />
Din nye adgangskode er <b><%=password%> </b>
<br /> <br />
Med venlig hilsen, identificer andetsteds.
<br /> <br />
Varsel! Dette er en automatisk genereret e-mail, skal du ikke svare.
]]></body>
<subject><![CDATA[Safewhere Identify - adgangskoden er nulstillet]]></subject>
</mail>
</mails>
Default email template
Identify uses the default email template when:
There is no language-specific template.
None of the language-specific templates match a user's language.
Creating a new email template
You can create a new email template by clicking on the (+) button next to the Language code textbox.
Language codes must use the two-letter codes of ISO 639-1.
Please note that language code is case-insensitive and fallback rule applies. For example, if there is an email template whose language code is "es" but the user's browser language is "ES-AR" (Spanish - Argentina), the "es" template will be used for sending an email out to the user.
Editing an email template
You can edit an existing email template by mouse-hovering on the language column and clicking on the Edit button.
Deleting a new email template
You can delete an existing email template by mouse-hovering on the language column and clicking on the Delete button.