Difference between revisions of "Email Templates"

From Hornbill
Jump to navigation Jump to search
 
(26 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
This document can now be found at its new location in the [https://docs.hornbill.com/esp-config/email/templates/ Hornbill Document Library].
 +
 +
[[file:hornbill-document-library.png|Hornbill Cloud|link=https://docs.hornbill.com/esp-config/email/templates/]]
 +
<!--
 +
 
<div style="border:1px solid #90C0FF; background:#D0E0FF; width:99%; padding:4px; margin-bottom:10px;">
 
<div style="border:1px solid #90C0FF; background:#D0E0FF; width:99%; padding:4px; margin-bottom:10px;">
__NOTOC__[[Main Page|Home]] > [[Administration]] > [[System Administration |System]] > [[Email Administration|Email]] > Templates
+
__NOTOC__
 +
{| style="width:100%"
 +
|[[Main Page|Home]] > [[Administration]] > [[System Administration |System]] > [[Email Administration|Email]] > Templates
 +
|style="text-align:right;"|[[:Category:Administration|Index]]
 +
|}
 
</div>
 
</div>
{{#ev:youtube|mvF7saw4MCI|400|right}}
+
{|style="width: 100%"
 +
|- valign="top"
 +
|style="width:73%"|
 
==Introduction==
 
==Introduction==
 
Email templates can be used to pre-populate emails with information to create a standard format for outbound emails.  Emails may be sent automatically from Business Process Workflows or manually from within an app.
 
Email templates can be used to pre-populate emails with information to create a standard format for outbound emails.  Emails may be sent automatically from Business Process Workflows or manually from within an app.
 +
|style="width:5%"|
 +
|
 +
|style="width:22%; border-style: solid; border-width: 1px; border-color:#e6e6e6; background-color:#f2f2f2;"|
 +
 +
== Related Articles ==
 +
:* [[Email_Action_Item|Email Action Items]]
 +
|}
 +
{{#ev:youtube|mvF7saw4MCI|350|right}}
  
 
==Template List==
 
==Template List==
Line 10: Line 29:
  
 
== Template Editor ==
 
== Template Editor ==
 
+
The ''Template Editor'' is used to construct your email templates.  Within the Editor you provide the following areas.
* '''Name'''
+
:* '''Name'''
: The Name provides a reference within the list of Templates.   
+
:: The Name provides a reference within the list of Templates.  The BPM Editor and the different Apps that use email templates will also use this name to display where email template selection is available.
* '''Subject'''
+
:* '''Subject'''
: Contents of the Subject of the email.  Both text and variables can be used within this section.
+
:: Contents of the Subject of the email.  Both text and variables can be used within this section.
* '''Message'''
+
:* '''Message'''
: The main body of the email.  When creating or modifying an email template, the Message area includes a full editor to provide options for fonts and styling within your email.
+
:: The main body of the email.  When creating or modifying an email template, the Message area includes a full editor to provide options for fonts and styling within your email.
  
 
== Variables ==
 
== Variables ==
Line 34: Line 53:
 
::* <nowiki>{{DATE}}</nowiki> = The current date in the format 2016-11-23
 
::* <nowiki>{{DATE}}</nowiki> = The current date in the format 2016-11-23
 
::* <nowiki>{{TIME}}</nowiki> = The current time in the format 23:53
 
::* <nowiki>{{TIME}}</nowiki> = The current time in the format 23:53
 +
::* <nowiki>{{instanceId}}</nowiki> = The id of the Hornbill instance
  
==Using ESP Conditions with a Variable==
+
:* '''Modifiers'''
There are occasions when the variable you have chosen to include in your email template does not have any data to resolve. In this situation, you will be left with the raw variable displayed in the email and of course this doesn't look good to the recipient.
+
:: The following modifiers are used with variables and are available: For example
 +
::* <nowiki>{{.H_firstname|upper}}</nowiki> = Will force the value to uppercase i.e JOHN.
 +
::* <nowiki>{{.h_firstname|lower}}</nowiki> = Will force the value to lowercase i.e john.
 +
::* <nowiki>{{.h_firstname|empty}}</nowiki> = Will only show the value if it exists else the variable will be removed from the output.
 +
::* <nowiki>{{.h_firstname|html}}</nowiki> = Allows HTML output from a template variable instead of HTML being shown as text.
 +
::* <nowiki>{{.h_firstname|wiki}}</nowiki> = Allows HTML output from a template variable that contains wiki markup, Currently only basic formatting (Bold, Italic, Ordered & Unordered lists) are supported.
 +
::* <nowiki>{{.datetimevariable|formatLocalTime}}</nowiki> = Allows formatting of datetime variables using system regional settings ('''system.RegionalSettings.timezone''' & '''system.RegionalSettings.dateTimeFormat'''), without this formatting the date time will use the DB value (UTC).
 +
{{infobox|''Modifiers do not apply for extended variables. For example, modifiers cannot be applied (they will not work) on variables like "Customer Coworker.H_first_name"''}}
 +
 
 +
==Variable Visibility ==
 +
 
 +
===The "empty" Variable Modifier===
 +
Sometimes you may want to include a variable in your email template that you find under certain circumstances may not be populated. You will notice that when variables fail to find any corresponding information in the database they simply show themselves in their raw form: '''<nowiki>{{.variable}}</nowiki>'''. This doesn't look terribly good in your otherwise beautifully prepared email templates.
 +
 
 +
Using the "empty" modifier is a simple way to guard against this situation. Adding a vertical bar followed by the the word "empty" i.e. "'''|empty'''" within the curly braces of your variable will hide it if the system finds that there is no information to show. This results in: '''<nowiki>{{.variable|empty}}</nowiki>'''.
 
<br>
 
<br>
 
<br>
 
<br>
It is possible to avoid this through the use of an ESP Expression. This is an expression that controls whether the variable specified should be visible in the email being sent.
+
===ESP Conditions===
i.e. If the expression evaluates to “True” then display the variable. If the expression evaluates to “False” then hide the variable completely.
+
ESP conditions are a more advanced way of controlling the visibility of variables within your email templates and they can also be applied to blocks of text too.  
 
<br>
 
<br>
 +
An ESP expression controls whether the variable or specified text should be visible in the email being sent.
 +
i.e. If the expression evaluates to “True” then display the variable or text. If the expression evaluates to “False” then hide the variable or text completely.
 +
<br>
 +
Ultimately, the visibility of the variable or text is dependent purely on the condition set against it. It is not dependent on whether any data exists in the database for the variable to resolve.
 +
<br>
 +
====What Operators can I use in my ESP Conditions?====
 +
The operators "'''='''" (equal to) and "'''!='''" (not equal to) are supported.
 
<br>
 
<br>
Ultimately, the visibility of the variable is dependent purely on the condition set against it. It is not dependent on whether any data exists in the database for the variable to resolve.
 
  
===The Co-Worker Vs Contact Example===
+
====The Co-Worker Vs Contact ESP Condition Example====
 
One common situation where the ESP expression is essential is when you want to begin your emails with “Dear [Customer]”.
 
One common situation where the ESP expression is essential is when you want to begin your emails with “Dear [Customer]”.
 
<br>
 
<br>
Line 65: Line 105:
 
<li>Click OK</li>
 
<li>Click OK</li>
 
</ol>
 
</ol>
 +
<br>
 +
'''Hornbill Hint:''' The example described here is evaluating a variable (Customer Type) that will contain a number (0 or 1). In other situations, you might want to evaluate a variable that contains a word, such as <nowiki>{{.H_resolvedby_teamname}}</nowiki>. When doing this the variable must be surrounded by single quotes e.g. '''<nowiki>'{{.H_resolvedby_teamname}}'</nowiki> = 'My Team'.''' i.e. if resolved by team name equals "My Team", show the text bound by the ESP expression.
 +
<br>
 
<br>
 
<br>
 
When viewing your email template, any variable currently under the control of an ESP expression is highlighted in Grey.
 
When viewing your email template, any variable currently under the control of an ESP expression is highlighted in Grey.
Line 82: Line 125:
  
 
[[Category:Administration]][[Category:Videos]]
 
[[Category:Administration]][[Category:Videos]]
 +
-->
 +
<<!-- esp-config/email/templates -->
 +
[[Category:HDOC]]

Latest revision as of 18:43, 11 April 2024

This document can now be found at its new location in the Hornbill Document Library.

Hornbill Cloud <