Here are some examples that show you what ESL can do when it is built into the template blocks.
Header/footer
Common building blocks that are used in almost all campaigns are the header and footer. You could use the header to display the member's loyalty point count and status as a reminder. Also a different footer message can be shown, for example, depending on whether or not the contact is a VIP.
In this simplified email html code the decisive pieces are the values of Membership
Token
, Membership Credit
, Membership Fee
and Membership Credit
for a given contact.
<table>
<tr>
<td>
{% if contact.164 == 'Membership Token' and contact.165 == '325' %} Hello signed up VIP member, here is you nice discount
</td>
{% elseif contact.164 == 'Membership Token' and contact.165 == '330' %}<br>*I see you have not signed up yet, how about doing it?<br>
{% elseif contact.164 == 'Membership Credit' and contact.165 == '330' %}Join our extra VIP program too for exclusive benefits!
{% elseif contact.164 == 'Membership Fee' and contact.165 == '330' %}<br> You should know that membership costs you X amount of money.
{% elseif contact.164 == 'Membership Credit' and contact.165 == '325' %}<br> This offer is just for you now and we may revoke it later on,
{% else %}
Some fallback text and content if none of the previous conditions are true.
{% endif %} </table>
Advanced transactional section with complex logic/loop
For example, an order cancellation email typically has a section showing the items cancelled and the total amount refunded. This usually requires a product loop to display the items and a certain logic to determine what item information and/or pricing (like discounts, shipping, etc) to show.
example
code code
</table>
</td>
</tr>
{% foreach ordercancel in event.global.products %}
<tr>
<tr>
<td align="center" class="lh dplr10"><font class="ff fst2 fc3"><span class="la2u" style="line-height: 18px;">{{ordercancel.size}}</span></font></td>
</tr>
{% if order.color != '' and order.color != 'null' %}
<tr>
<td align="center" class="lh dplr10"><font class="ff fst2 fc3"><span class="la2u" style="line-height: 18px;">Color: {{ordercancel.color}}</span></font></td>
</tr>
{% endif %}
<tr>
<td height="{variables.dseph}" class="hide"><img src="{variables.trans}" height="1" style="display:block;"></td>
</tr>
<tr>
<td align="center" class="lh dplr10"><font class="ff fst2 fc3"><span class="la2u" style="line-height: 18px;">QUANTITY: {{ordercancel.quantity}}</span></font></td>
</tr>
<tr>
<td align="center" class="lh dplr10"><font class="ff fst2 fc3 fwb"><span class="la2u" style="line-height: 18px;">PRICE: ${{ordercancel.price}}</span></font></td>
</tr>
<tr>
<td align="center" class="lh dplr10"><font class="ff fst2 fc3 fwb"><span class="la2u" style="line-height: 18px; color:#cf102c;"> {% if ordercancel.discount != '0.00' and ordercancel.discount != '' and ordercancel.discount != 'null' %}
{{ordercancel.discount|format('$')}}
{% endif %}</span></font>
</td>
</tr>
</table>
</th>
</tr>
<tr>
<td style="height: 30px;"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="25" class="mdivw">
<div></div>
</td>
<td>
<table align="left" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td height="1" class="navbgheader">
<div></div>
</td>
</tr>
</table>
</td>
<td width="25" class="mdivw">
<div></div>
</td>
</tr>
</table>
</td>
</tr>
{% endforeach %}
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="padding: 0px 30px">
<table width="100%" border="0" cellspacing="0" cellpadding="0" dir="rtl">
<tr>
<td style="height: 30px;"></td>
</tr>
<tr>
<th dir="ltr" style="vertical-align: middle" class="fl">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="center" class="lh" dir="ltr"><font class="ff fst2 fc3 fwb">{% if event.global.subTotal != '' and event.global.subTotal != 'null' %}
Order Subtotal: ${{event.global.subTotal}}<br>
{% endif %}
{% if event.global.discount != '0.00' and event.global.discount != '' and event.global.discount != 'null' %}
Discount: <span style="color:#cf102c;">${{event.global.discount}}</span><br>
{% endif %}
{% if event.global.shippingCost != '0.00' and event.global.shippingCost != '' and event.global.shippingCost != 'null' %}
Shipping: ${{event.global.shippingCost}}<br>
{% endif %}
{% if event.global.shippingDiscount != '0.00' and event.global.shippingDiscount != '' and event.global.shippingDiscount != 'null' %}
Shipping Discount: <span style="color:#cf102c;">${{event.global.shippingDiscount}}</span><br>
{% endif %}
{% if event.global.tax != '' and event.global.tax != 'null' %}
Total Tax: ${{event.global.tax}}{% endif %}</font>
</td>
</tr>
<tr>
<td align="center" style="font-size: 1px; height: 20px"> </td>
</tr>
<tr>
<td align="center" class="totalbg">
<table border="0" cellspacing="0" cellpadding="0" role="presentation" align="center" class="fw">
<tr>
<td style="padding: 20px;" align="center" class="lh" dir="ltr"><font class="ff fst3 fc1 fwb"><span class="la2b">Order Total: ${{event.global.total}}</span></font></td>
</tr>
</table>
How it renders in a mail approximately: