Skip to content

Templates

Templates define the content for notifications (e.g., task assignments, reminders). They can be used to create email notifications or generate documents from the scripting environment. Emakin provides default templates, but these can be customized or new templates created.

Creating Message Templates

  1. Navigate to the pool where you want to create a template.
  2. Click the "Add New Template" button to open the template editor.
  3. Enter the following information:

    • Name: The template's identifier.
    • Subject: The template's subject line (for email notifications).
    • Type: Selects the template type:
      • Standard: Uses data templates for text-based content.
      • XSLT: Uses XSLT for XML-based content.
  4. Click "Done". "Edit" and "Details" buttons will appear. The "Details" button opens the content editor.

Standard Type Template

Standard templates use text with embedded data template expressions. Please refer to data templates for details.

XSLT Type Template

XSLT templates use XML for content definition. You can either use the default templates or create your own.

Rendering templates from scripts

Templates can be rendered from scripts using the $Templates object.

1
var content = $Templates.Format('Receipt', $Xml);

For scripting details, refer to the $Templates for more details.

Default Templates

Info

Email clients may restrict external resource loading (CSS, JavaScript) for security reasons. Keep styles inline within the HTML.

XSLT Templates

XSLT templates offer advanced formatting capabilities using XML transformations. Refer to external XSLT standard documentation for details.

Examples

Task Assigned Notification

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html>
<body style="margin:0; padding:0">
<div style="margin:1em">
    <p><b>{{ $Recipients }}</b>,</p>
    <p>You have a new task named {{ $WorkItem.Caption }}.</p>
    <p>
        <a style="display:inline-block; padding:5px; border:outset 1px; background-color: #D7DEF0; text-decoration:none;"
           href="{{ $DomainUrl }}/app/?/workitem/{{ $WorkItem.Id }}">{{ $WorkItem.Caption }}</a>
    </p>
    <p>{{ $WorkItem.Instructions }}</p>
    <p><u>Details</u>
        <br></br>
        <b>Form number</b> {{ $Instance.Number }},<br></br>
        {{ if $WorkItem.DeadlineDate then <b>Deadline date</b> {{ $WorkItem.DeadlineDate }} }}
    </p>
</div>
<div style="margin:0 0 0 0; padding:0.5em 0 0.5em 1em;background-color:#666">
    <a href="{{ $DomainUrl }}/">
        <img src="{{ $LogoUrl }}" border="0"></img>
    </a>
</div>
</body>
</html>

Reminder

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html>
<body style="margin:0; padding:0">
<div style="margin:1em">
    <p><b>{{ $Recipients }}</b>,</p>
    <p>{{ $WorkItem.Caption }} still waiting in your task list. Please review.</p>
    <p>
        <a style="display:inline-block; padding:5px; border:outset 1px; background-color: #D7DEF0; text-decoration:none;"
           href="{{ $DomainUrl }}/app/?/workitem/{{ $WorkItem.Id }}">{{ $WorkItem.Caption }}</a>
    </p>
    <p>{{ $WorkItem.Instructions }}</p>
    <p><u>Details</u>
        <br></br>
        <b>Form number</b> {{ $Instance.Number }},<br></br>
        {{ if $WorkItem.DeadlineDate then <b>Deadline date</b> {{ $WorkItem.DeadlineDate }} }}
    </p>
</div>
<div style="margin:0 0 0 0; padding:0.5em 0 0.5em 1em;background-color:#666">
    <a href="{{ $DomainUrl }}/">
        <img src="{{ $LogoUrl }}" border="0"></img>
    </a>
</div>
</body>
</html>