Template overview
Templates are reusable pieces of text with placeholders for dynamic content. You can use them, for example, to generate mails or notes from a package.
You can also link them to a service to serve dynamic or static HTML pages. In this way, you can even build a full-blown web application.
Templates are stored in the Templates tab. Each template has:
- A name used to identify the template
- A render mode for dynamic content
- A subject, text, and/or HTML
Render modes
The automator supports three template styles:
| Style | Syntax | Use case |
|---|---|---|
| Comment style | <!--# expr #--> | HTML templates edited in an external HTML editor |
| Curly style | {{ expr }} | Concise templates (not compatible with frameworks like Angular.) |
| ASP style | <%= expr %> | Templates needing full JavaScript control flow |
Each template has a render mode field that controls which style(s) are processed.
| Mode | Description |
|---|---|
| Comment, Curly, ASP | Processes all three styles in sequence: Comment → Curly → ASP. Allows mixing styles in one template. |
| Comment style | Comment style only |
| Curly style | Curly style only |
| ASP style | ASP style only |
| None | For templates without any dynamic content |
When the render mode is set to Comment, Curly, ASP, the template is processed through each renderer in order.
This means you can combine styles in a single template, but you should be aware that the output of one renderer
becomes the input for the next.
Accessing data
Templates can reference global variables (variables starting with $) defined in the script.
For example, if the script defines $workflow, the template can use $workflow.subject to
access the subject of the workflow.
See Variables for details on global and local variables.