-
Notifications
You must be signed in to change notification settings - Fork 13
Cheat Sheet for Email
You're currently viewing XMPL V3
Attention: XMPL V5 beta is now available!
This page acts as a quick reminder for the email creation workflow, and as a source for code snippets which can be easily copied and pasted.
Note: Email clients do not support all features which are supported by web browsers. Therefore, XMPL for email only supports that subset of the XMPL language which the email clients support.
-
Example 1: Email clients do not support JavaScript, therefore XMPL for email does not support JavaScript.
-
Example 2: Email clients do not support external CSS files but do support inline styles, therefore XMPL for email does not support external CSS files but does support inline styles.
Emails can be in HTML and/or Text formats. Both formats support nesting of XMPL code.
About Text emails: Due to the limitations of a text emails, some HTML email features are not supported in Text emails. For example, Style and Graphic ADORs are not supported in Text emails.
About HTML email testing: After defining the HTML email body, you can test the HTML page in your browser before uploading it to the email touchpoint. To test the email page in your browser, you have to download the Config file and add the web tags in the Head and Body/Div tags (see Cheat Sheet for Web for more details). Note that the XMPL email interpreter will ignore the web tags.
{{xmp.r['My TextAdor']}}
{{xmp.r["My TextAdor"]}}
{{xmp.r.MyTextAdor}}
Using graphic assets and a Graphic ADOR:
<img xmp-image-asset="xmp.r.MyAdor"/>
Using a URL in Text ADOR:
<img xmp-image-asset="xmp.r.MyAdor"/>
<img src="{{xmp.r.MyAdor}}"/>
Emails sent with XMPie Email Services (XES) can contain Style ADORs. To switch the class of an HTML element based on the Style ADOR, have the Style ADOR return the value of the desired class. In the example below MaleStyle
or FemaleStyle
or NoGenderStyle
are the value set for the Style ADOR. Set the xmp-class
to the ADOR. Note that email supports only class selectors (no expressions).
<html>
<head>
<style xmp-email-style="true">
.MaleStyle {color: blue;}
.FemaleStyle {color: red;}
.NoGenderStyle {color: black;}
</style>
</head>
<body>
<h2>Style</h2>
<div xmp-class="xmp.r.GenderStyle">Text style varies per recipient</div>
</body>
Emails sent with XMPie Email Services (XES) can contain Visibility ADORs. Visibility can be used on either div or span tags. The ADOR must by a Visibility ADOR, and the value can only be true or false. Expressions are not allowed.
<div xmp-show="xmp.r['IsStudent']">Show if IsStudent is 'true'.</div>
Or
<span xmp-show="xmp.r['IsStudent']">Show if IsStudent is 'true'.</span>
Create a link to an address supplied by an ADOR.
<a xmp-href="{{xmp.r['Blog']}}">users blog</a>
Emails sent with XMPie Email Services (XES) can contain HTML tables:
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr xmp-repeat="Department in xmp.r.Departments">
<td>{{Department.FirstName}}</td>
<td>{{Department.LastName}}</td>
</tr>
</table>
Or
<ul>
<li xmp-repeat="item in xmp.r['Fuel Consumption']">
{{item.Date}}: {{item.Liter}} Liters
</li>
</ul>
-
PDF On Demand Special ADORs
If your Circle project has one or more PDF on Demand touchpoints, your email can include a link to download the PDF by simply adding the PDF on Demand Special ADOR specifying the relevant Touchpoint ID. (P1 in the below example.)
The PDF on Demand document will display the data available at the time the email was sent.
<a xmp-href="{{xmp.r['XMPie.PDF.P1']}}">View the PDF</a>
-
Web Touchpoint Special ADORs
If your Circle project has one or more Webpage Touchpoints, your email can include a link to the Webpage by simply adding the Special Web ADOR specifying the relevant Touchpoint ID. (W1 in the below example.)
<a xmp-href="{{xmp.r['XMPie.Web.W1']}}" title="Click here">Click here</a>
Using the Web Touchpoint Special ADOR like this will automatically add link source and media parameters to the URL. Refer to Link source and media tracking for more information.
-
XMPieRecipientKey Special ADOR
The XMPieRecipientKey can be added as plain text, or part of a link by using:
{{xmp.r.XMPieRecipientKey}}
-
XMPieRURL Special ADOR
The XMPieRURL Special ADOR has been deprecated and will be removed in a future version. Please use Web Touchpoint Special ADORs instead.
-
View in Browser
An automated "View in Browser" link can be added to emails sent with XMPie Email Services (XES). By default the link will be available for 30 days.
<a xmp-href="{{XMPie.Email.ViewInBrowser}}">View in browser</a>
-
Email Footer (for anti-spam legislation e.g. CAN SPAM act)
<div style="font-size: 9px; color: #6b6b6b;">UNSUBSCRIBE<br /> If you do not wish to receive future email publication from us please <a xmp-href="{{XMPie.Email.Commercial.UnsubscribeURL}}">click here</a>.<br /> <br /> CONTACT US<br /> You can reply to this email, or contact us via postal mail at:<br /> {{XMPie.Email.Sender.BusinessName}}<br /> {{XMPie.Email.Sender.Address}} {{XMPie.Email.Sender.City}}, {{XMPie.Email.Sender.State}}, {{XMPie.Email.Sender.ZIPCode}} {{XMPie.Email.Sender.Country}}</div>
Note that all these ADORs use the following format:
{{XMPie.Email.Sender.Address}}
-
Unsubscribe
<a xmp-href="{{XMPie.Email.Commercial.UnsubscribeURL}}">Unsubscribe</a>
Requires XES version 3.5 and above. Circle automatically assigns each link a tracking name. If you wish you may define your own tracking name in order to easily identify specific links in your email.
<a xmp-tracking-action="ViewInBrowser" href="{{XMPie.Email.ViewInBrowser}}">View in browser</a>
Link tags can include the numbers 0–9, the letters A–Z (both uppercase and lowercase, English only), hyphens (-) and underscores (_). Spaces and special characters are not allowed.
Requires XES version 3.5 and above. If tracking email activity is enabled, all links in the email are tracked. To prevent tracking of a specific link, add
<a xmp-no-track="1" href="{{XMPie.Email.ViewInBrowser}}">View in Browser</a>
Note that "1" indicates no tracking and it is not a customizable value.
Circle Web Analytics can be used to track the source and media of links that lead customers to personalized web pages. Circle Email Touchpoints will automatically add source and media parameters that will be used for tracking. If desired, you can override the default settings. For more information, refer to the Cheat Sheet for Web.
Same as with HTML.
{{xmp.r.myTextAdor}}
Text emails sent with XMPie Email Services (XES) can contain Visibility ADORs:
<text xmp-show="AdorName1">Lorem Ipsum.</text>
The span tag also works in this case.
Not supported in Text emails.
Not supported in Text emails.
Text emails sent with XMPie Email Services (XES) can include Table ADORs to create space- or tab-separated lists:
<text xmp-repeat="Department in xmp.r.Departments">
{{Department["First Name"]}} {{Department["Last Name"]}}
</text>
Link (href tag) is not available in a Text email. To write the URL as text, use the Link ADOR as if it was a Text ADOR:
{{xmp.r.XMPieRURL}}
Not supported in Text emails.
Nesting is allowed.
<text xmp-show="xmp.r['IsStudent']">">{{FirstName}} , you are entitled to 20% discount <text xmp-show ="xmp.r['IsGraduateStudent']"> and a second item for 50% discount</text> </text>
You're currently viewing XMPL V3. Alternatively, go to XMPL V5 beta.
New!! Take a look at XMPL V5 Beta