<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://docs.sailthru.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>Sailthru Docs syntax</title>
        <description></description>
        <link>http://docs.sailthru.com/</link>
        <lastBuildDate>Thu, 17 May 2012 15:52:15 -0500</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>http://docs.sailthru.com/lib/images/favicon.ico</url>
            <title>Sailthru Docs</title>
            <link>http://docs.sailthru.com/</link>
        </image>
        <item>
            <title>syntax:assignment</title>
            <link>http://docs.sailthru.com/syntax/assignment</link>
            <description>You can use the = operator to do assignments to local variables. 


{variable = value}
{variable.attribute = value}


This is especially useful if you are calculating content that you want to loop through. It's usually more convenient to assign these to a temporary variable that you can use later:</description>
        <category>syntax</category>
            <pubDate>Tue, 05 Apr 2011 16:39:22 -0500</pubDate>
        </item>
        <item>
            <title>syntax:basics</title>
            <link>http://docs.sailthru.com/syntax/basics</link>
            <description>Replacement Variables


A template is normally HTML or text, with replacement variables and syntax enclosed in {curly braces} or {{double curly braces}}  For example,


&lt;p&gt;Your email address is: {email}!&lt;/p&gt;


You can pass in replacement variables as part of a send call, or set them on the email address via an email call.</description>
        <category>syntax</category>
            <pubDate>Tue, 07 Feb 2012 12:02:07 -0500</pubDate>
        </item>
        <item>
            <title>syntax:braces</title>
            <link>http://docs.sailthru.com/syntax/braces</link>
            <description>Most of the time, you can use single and double braces interchangeably on Sailthru. This:


&lt;p&gt;Dear {name},&lt;/p&gt;


usually means the same thing as this:


&lt;p&gt;Dear {{name}},&lt;/p&gt;


The difference is if you are generating blast content from a template. In this case, in your template:</description>
        <category>syntax</category>
            <pubDate>Thu, 24 Feb 2011 18:27:54 -0500</pubDate>
        </item>
        <item>
            <title>syntax:common-zephyr-examples</title>
            <link>http://docs.sailthru.com/syntax/common-zephyr-examples</link>
            <description>Overview

Based on frequent client requests and support tickets, we'll continue to add examples to this page to help you best utilize Zephyr's power. Don't see something here? Let us know!

Email Examples

For use in email templates/campaign emails.</description>
        <category>syntax</category>
            <pubDate>Mon, 31 Oct 2011 14:43:26 -0500</pubDate>
        </item>
        <item>
            <title>syntax:control-structures</title>
            <link>http://docs.sailthru.com/syntax/control-structures</link>
            <description>Simple variable replacement is not enough for more complex, personalized templates. Sailthru supports several types of control structures, conditionals, and loops:

{if}


Usage: {if expression}result{/if}

You can use {if}...{/if} to display something only based on a particular condition. For if's purposes, 0, &quot;&quot; (empty string), null, and false all evaluate to false, and anything else evaluates to true.</description>
        <category>syntax</category>
            <pubDate>Mon, 10 Oct 2011 16:23:53 -0500</pubDate>
        </item>
        <item>
            <title>syntax:expressions</title>
            <link>http://docs.sailthru.com/syntax/expressions</link>
            <description>Anything inside {curly braces} is evaluated as an expression. Expressions are in a Javascript-like format.

Strings


Use either single-quotes or double-quotes to denote strings, as you prefer. The backslash is used to escape quotes.


{&quot;apples&quot;} is the same as {'apples'}
{'What\'s up?'}</description>
        <category>syntax</category>
            <pubDate>Mon, 05 Dec 2011 13:26:17 -0500</pubDate>
        </item>
        <item>
            <title>syntax:home</title>
            <link>http://docs.sailthru.com/syntax/home</link>
            <description>Overview

Sailthru includes a sophisticated template syntax called &quot;Zephyr&quot; that lets you personalize emails. Unless otherwise noted, all of this syntax applies both to transactional and campaign messages.

You can use Zephyr in the following places:</description>
        <category>syntax</category>
            <pubDate>Mon, 31 Oct 2011 13:14:43 -0500</pubDate>
        </item>
        <item>
            <title>syntax:horizon-functions</title>
            <link>http://docs.sailthru.com/syntax/horizon-functions</link>
            <description>Horizon Functions


These functions are used to personalize an email based on a user's location, interests, activity level, and more. In general, they return a floating-point number, so they are particularly useful when combined with the {select} control structure, which lets you pick between pieces of content based on the maximum of several values.</description>
        <category>syntax</category>
            <pubDate>Sat, 24 Jul 2010 17:07:43 -0500</pubDate>
        </item>
        <item>
            <title>syntax:link-rewriting</title>
            <link>http://docs.sailthru.com/syntax/link-rewriting</link>
            <description>If you create a link that contains Zephyr code as part of the link, such as


http://example.com/path?email={email}


The link is bundled together as a single distinct rewritten link. Therefore you can track the performance of that link across users, rather than have it render and track as thousands or millions of different individual links.</description>
        <category>syntax</category>
            <pubDate>Fri, 27 Apr 2012 14:25:50 -0500</pubDate>
        </item>
        <item>
            <title>syntax:message</title>
            <link>http://docs.sailthru.com/syntax/message</link>
            <description>Within any Zephyr context, the message object contains a number of useful pieces of data about the current transactional email message.

Here is a sample message object:


{
	&quot;template&quot; : &quot;DC-template&quot; ,
	&quot;sample&quot;: &quot;A&quot;,
	&quot;revision_id&quot; : 131152 ,
	&quot;send_time&quot; : 1311284816 ,
	&quot;click_time&quot; : 1301384816 ,
	&quot;open_time&quot; : 1301394816 ,
	&quot;purchase_time&quot; : 1309366347,
	&quot;clicks&quot;: [
		{
			&quot;ts&quot;: 1309366347,
			&quot;ip&quot;: &quot;75.214.213.71&quot;
		},
		{
			&quot;ts&quot;: 1309366357,
			&quot;ip&quot;: &quot;75.214.213.71&quot;
		}
	],
	&quot;opens&quot;: [
…</description>
        <category>syntax</category>
            <pubDate>Wed, 01 Feb 2012 13:21:22 -0500</pubDate>
        </item>
        <item>
            <title>syntax:profile</title>
            <link>http://docs.sailthru.com/syntax/profile</link>
            <description>Within any Zephyr context, the profile object contains a number of useful pieces of data about the current user.

Here is a sample profile object:


{
  &quot;id&quot; : &quot;4d915c32cc0c1adbb141b547&quot; ,
  &quot;email&quot; : &quot;example@example.com&quot; ,
  &quot;lists&quot; : [ &quot;List A&quot; , &quot;List B&quot;] ,
  &quot;lists_signup&quot; : { &quot;List A&quot; : 1302864589 , &quot;List B&quot; : 1302164760} ,
  &quot;vars&quot; : { &quot;name&quot; : &quot;Joe Smith&quot; , &quot;gender&quot; : &quot;M&quot;} ,
  &quot;signup_time&quot; : 1302164760 ,
  &quot;open_time&quot; : 1311284816 ,
  &quot;click_time&quot; : 1311521398 ,
  &quot;purchase_time&quot; : 1309…</description>
        <category>syntax</category>
            <pubDate>Mon, 25 Jul 2011 19:58:00 -0500</pubDate>
        </item>
    </channel>
</rss>

