Special Functions

View online

Creating a 'View online' link requires special code, because it's different for every message and not yet known when the template is applied. We dealt with that for you by creating a special macro for this:

<a href="<@onlineLinkUrl/>">View online</a>

Please note that an Archive FlowStep is required if you want to have a view online link, since that's what we will link to. If one is missing but a template requires it, messages will be held. The Archive FlowStep does not need to be set before the Template that refers to it, so you can still for instance insert it at the end of the Flow.


Editable regions

If you want to make regions of a template editable using the Quick editor (real templates only, not applicable to FlowStep settings), you can mark it like this:

         <#-- REGION: intro -->
           This is a text.
         <#-- END REGION: intro -->

Every region in a template needs to have a unique name (in this case "intro"). We advise keeping the regions as small as possible, containing only paragraphs of text or other single elements such as a table cell containing a logo image. Using a visual editor to edit more complex structures, although allowed, is tricky and might produce unexpected results.



It's also possible to include other templates. This allows for reusing (parts of) templates. Examples of this include headers, footers, and banners. Having these in separate templates means you can edit them in one place and change them in all relevant messages at once.

Suppose 1040 is the ID of another template in the same account containing a shared footer. Code for including it would look like this:

<#include "1040">

Please note that Editable regions are disabled when using the Quick editor on the 'outer' template. This prevents accidental changes that affect other templates.


Link names

The Flowmailer, you can find the Top Links report under Reports - Flows - (your flow name). The Top Links box shows you the most clicked links from that flow. By default, the url of that link is shown. But what is you want to see more human-legible names in this overview? Simply add a data-name attribute to your links:

<a href = "https://yoururl.com" data-name = "sample link name">Click here</a>

Links with the same name are bundled in the Top Links report.


Special variables

There's a number of special variables available for use in Flowmailer message templates:

Variable Description Example
flowmailer.account.id ID of Account 0246
flowmailer.account.description Description of Account MyAccount Production
flowmailer.source.id ID of Source 1234
flowmailer.source.description Description of Source Webshop
flowmailer.flow.id ID of Flow 5678
flowmailer.flow.description Description of Flow Order confirmations
receivedMessage.id Flowmailer Message ID 201512161426489b63289c577efc89e2
receivedMessage.sender (SMTP) Sender address support@flowmailer.com
receivedMessage.from From header email address Flowmailer Support <support@flowmailer.com>
receivedMessage.recipient Recipient address support@flowmailer.com
receivedMessage.subject Message subject This is a test subject
receivedMessage.headers['Content-Transfer-Encoding'] Headers quoted-printable
currentMessage.sender (SMTP) Sender address support@flowmailer.com
currentMessage.from From header email address support@flowmailer.com
currentMessage.recipient Recipient address support@flowmailer.com
currentMessage.subject Message subject This is a test subject
currentMessage.headers['From'] Headers Flowmailer Support <support@flowmailer.com>
currentMessage.headers['header name'] Headers  
inPreview If in editor preview true

Event variables

Variable Description Example
event.received Event received (timestamp) 2021-07-29T08:51:26.039Z
event.type Type of event OPENED
event.data Data from message 1234
event.message.id ID of event 12345abcd
event.message.type Type of message EMAIL
event.message.sender Sender of message sender@flowmailer.com
event.message.recipient Recipient of message recipient@flowmailer.com
event.message.subject Subject of message Lorem ipsum dolor sit amet
event.message.from From header email address sender@flowmailer.com
event.message.headersIn Original headers received ['Content-Transfer-Encoding']
event.message.headersOut Headers sent out ['Content-Transfer-Encoding']