Mail Templates
The mailkit templates take use of HTML enhanced by the power of dynamic templating by Template Toolkit.
This allows creating templates with dynamic content retrieved via mailkit's datasources, include supplemental template files, create conditionals and loops to represent the information and lot of other interresting stuff. The full documentation to all the features of templates can be found in Template Toolkit documentation.
Following are the basic tags for use in your templates:
- [CONTENT] - will load the content of the campaign from the campaign editor into the template. Additional areas in the campaign editor can be loaded as well using [CONTENT2], [CONTENT3], [CONTENT4] and [CONTENT5] tags.
- [% FOREACH data.DS_RSS_example -%] - Creates a loop thru all the data in the RSS Data source named example. Loop MUST be finished by [% END -%]. The RSS data fields are returned as [% TITLE -%], [% URL -%], [% DESCRIPTION -%], etc. as in the source RSS feed. You can also use conditionals like [% IF -%], [% ELSE ], etc. to customize the output even better.
- To include the supplemental template files in your templates use [% INCLUDE filename.html -%]. This will include the supplemental file called filename including all the procedures defined in this file. This means you can use any conditionals, loops, data sources, etc in the supplemental files in the same manner as in the main template file.
- Custom tags used for mailing purposes are [SIGNOUT] to place an signout link in the email and [TRACK_IMG] to place a hidden tracking image for detailed statistics of email reach. If these tags are not part of your template, the system will insert the default tracking image and unsubscribe link.
Example template code:
<div> [% FOREACH data.DS_RSS_EXAMPLE -%] <div> <a href="[% URL -%]"><img src="[% ENCLOSURE -%]" alt="[% TITLE -%]" /></a><br /> <a href="[% URL -%]">[% TITLE -%]</a>[% DESCRIPTION -%] </div> [% END -%] </div> <div class="footer"> <div>You are receiving this newsletter as a registered user of Example.com. To unsubscribe click <a href="[SIGNOUT]" target="_blank">here</a>, or visit [SIGNOUT]</div> <div>© 2006 - <a href="http://www.example.com/" target="_blank">Example.com</a></div> </div> [TRACK_IMG]