Difference between revisions of "Email templates"

From TS NoCode wiki
Jump to navigation Jump to search
old>Admin
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Email templates ==
== Email templates ==
Templates can be changed in the designer:  
If you need to include graphics in the design we recommend  using inline base64 images.
Modules > Configuration
 
CSS is easily embeddable inside ''style'' tags
 
== Wrapping emails ==
It is possible to wrap all emails sent by the system in an [https://mjml.io/try-it-live/ MJML] or HTML wrapper.
 
Our implementation of the MJML engine is a bit unstable, so it is recommended to build the wrapper using MJML, then exporting the HTML version and uploading that to the platform.
 
Two tags are available: <code>[SUBJECT]</code> and <code>[BODY]</code>
 
SUBJECT will be replaced with the subject of the given email.
 
BODY will be replaced with the email-content of the given email.


If you need to include graphics in the design we recommend  using inline base64 images.
To enable email-wrapping, set the Policy <code>defaultEmailTemplateID</code> to the ID of the template.
 
You can control whether the content of the email is inserted into the template before or after rendering, via the Policy <code>emailDoInsertBeforeRender</code>.
 
== Inserting data ==
To insert data from a record,,into an email, the following syntax is used.
 
<code>{FIELDNAME}</code>
 
=== Custom functions ===
A couple of functions are implemented, allowing minor modification of data from fields, before inserting it.
 
Syntax: <code>@[FUNCTION]({FIELDNAME} [PARAMETER])</code>
 
==== Function: FALLBACK ====
Sample: <code>@FALLBACK({NAME} Friend)</code>
 
If the given field does not have a value, or is not found, the PARAMETER value will be used instead.
 
==== Function: DATEADD ====
Sample: <code>@DATEADD({DATE} 3 weeks)</code>
 
If the given field is a Date, Time or DateTime field, the value is modified by the given amount (positive or negative)
 
Supports wrapping inside FORMAT (see below).
 
Supported periods: minute(s), hour(s), day(s), week(s), month(s), year(s)
 
==== Function: DATESUB ====
Sample: <code>@DATESUB({DATE} 3 weeks)</code>
 
If the given field is a Date, Time or DateTime field, the value is modified by the given amount (positive or negative)
 
Supports wrapping inside FORMAT (see below).
 
Supported periods: minute(s), hour(s), day(s), week(s), month(s), year(s)
 
==== Function: FORMAT ====
Sample: <code>@FORMAT({NUMBER} 000.000)</code> or <code>@FORMAT({DATE} MMM, d YYYY)</code>
 
Formats a given number or date to the specified format.
 
Number formatting uses [https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html DecimalFormat] and date formatting uses [https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html SimpleDateFormat].
 
It is possible to wrap this function around DATESUB and DATEADD like this: <code>@FORMAT(@DATEADD({DATE} 3 weeks) MMM, d YYYY)</code>


CSS is easily embeddable inside ''script'' tags
== System templates ==
Templates can be changed in the designer: '''Modules > Configuration'''


=== Invitation template ===
=== Invitation template ===
HTML can be edited in '''Template.WelcomeUser'''
HTML can be edited in '''Template.WelcomeUser''' and '''Template.WelcomeUserLink'''


Supported tags
Supported tags
Line 17: Line 74:


=== Password reset template ===
=== Password reset template ===
HTML can be edited in '''Template.PasswordReset'''
HTML can be edited in '''Template.PasswordReset''' and '''Template.PasswordResetLink'''


Supported tags
Supported tags
* {LOGINURL}
* {LOGINURL}
* {PASSWORD}
* {PASSWORD}
=== Reset via link-templates ===
Additional supported tags
* {PASSWORDLINK}
* {LINKLIFETIME}

Latest revision as of 14:45, 4 February 2025

Email templates

If you need to include graphics in the design we recommend using inline base64 images.

CSS is easily embeddable inside style tags

Wrapping emails

It is possible to wrap all emails sent by the system in an MJML or HTML wrapper.

Our implementation of the MJML engine is a bit unstable, so it is recommended to build the wrapper using MJML, then exporting the HTML version and uploading that to the platform.

Two tags are available: [SUBJECT] and [BODY]

SUBJECT will be replaced with the subject of the given email.

BODY will be replaced with the email-content of the given email.

To enable email-wrapping, set the Policy defaultEmailTemplateID to the ID of the template.

You can control whether the content of the email is inserted into the template before or after rendering, via the Policy emailDoInsertBeforeRender.

Inserting data

To insert data from a record,,into an email, the following syntax is used.

{FIELDNAME}

Custom functions

A couple of functions are implemented, allowing minor modification of data from fields, before inserting it.

Syntax: @[FUNCTION]({FIELDNAME} [PARAMETER])

Function: FALLBACK

Sample: @FALLBACK({NAME} Friend)

If the given field does not have a value, or is not found, the PARAMETER value will be used instead.

Function: DATEADD

Sample: @DATEADD({DATE} 3 weeks)

If the given field is a Date, Time or DateTime field, the value is modified by the given amount (positive or negative)

Supports wrapping inside FORMAT (see below).

Supported periods: minute(s), hour(s), day(s), week(s), month(s), year(s)

Function: DATESUB

Sample: @DATESUB({DATE} 3 weeks)

If the given field is a Date, Time or DateTime field, the value is modified by the given amount (positive or negative)

Supports wrapping inside FORMAT (see below).

Supported periods: minute(s), hour(s), day(s), week(s), month(s), year(s)

Function: FORMAT

Sample: @FORMAT({NUMBER} 000.000) or @FORMAT({DATE} MMM, d YYYY)

Formats a given number or date to the specified format.

Number formatting uses DecimalFormat and date formatting uses SimpleDateFormat.

It is possible to wrap this function around DATESUB and DATEADD like this: @FORMAT(@DATEADD({DATE} 3 weeks) MMM, d YYYY)

System templates

Templates can be changed in the designer: Modules > Configuration

Invitation template

HTML can be edited in Template.WelcomeUser and Template.WelcomeUserLink

Supported tags

  • {APPLICATION}
  • {LOGINURL}
  • {USERNAME}
  • {PASSWORD}

Password reset template

HTML can be edited in Template.PasswordReset and Template.PasswordResetLink

Supported tags

  • {LOGINURL}
  • {PASSWORD}

Reset via link-templates

Additional supported tags

  • {PASSWORDLINK}
  • {LINKLIFETIME}