Email templates are prepared email messages, containing subject, HTML and text content, with variables, placeholders and template code that will be processed and replaced when an email is sent.
Email templates can be previewed from the Editor menu of an individual Email template.
...
Table of Contents |
---|
Child pages (Children Display) |
---|
...
Import/Export
Email templates can be imported/exported to/from Trivore Identity Service. These templates are saved as JSON files. All field names in the JSON file will correspond to the field found in the Email template editor.
Example:
Code Block | ||
---|---|---|
| ||
{
"meta" : { },
"name" : "Hello world",
"description" : "Test",
"templateEngine" : "VELOCITY",
"defaultLocale" : "fi",
"defaultTimeZone" : "Europe/Helsinki",
"subjectTemplate" : "$subject",
"htmlTemplate" : "<html><body><h1>Dear recipient</h1></body></html>\n$recipientUser\n\n$verificationUrl",
"textTemplate" : "$heading\n\n$content",
"localeProperties" : {
"fi" : {
"heading" : "Hei",
"subject" : "Mitä kuuluu",
"content" : "No eipä mitään tässä."
},
"en" : {
"heading" : "Hi",
"subject" : "How are you",
"content" : "Eh, nothing much going on."
}
},
"namespaceIds" : [ ]
} |
Locale = Language
During template processing the used Locale becomes important. It is used for example when choosing a translation, or how a date or time representation is generated.
...
If you add Locale specific properties, you should also specify a default Locale in your template. It is used if no other locale is selected when the email is being processed. Using locales and properties allows for easier creation of email templates as a single property can have multiple languages.
Template engines
Templates can be written as-is, but likely you will want to add dynamic content. Dynamic content may be parameters in links, the recipient’s name, or even the whole content using translations. How these dynamic parts are defined depends on the selected template engine.
...