Single Vs. Double Braces

Most of the time, you can use single and double braces interchangeably on Sailthru. This:

 <p>Dear {name},</p>

usually means the same thing as this:

 <p>Dear {{name}},</p>

The difference is if you are generating blast content from a template. In this case, in your template:

  • expressions in {single braces} are evaluated at campaign creation time, just once overall
  • expressions in {{double braces}} are evaluated at campaign send time, once for each individual user

For example, let’s suppose you wanted your email to contain the current date. If this is what’s in your template:

 generated on {date()} sent on {{date()}}

If you generate a campaign from this template on July 27, the following will appear in your campaign’s HTML source:

 generated on July 27, 2012 sent on {date()}

Then let’s say you don’t send it out until the next day. Users will see this:

 generated on July 27, 2012 sent on July 28, 2012

Why Does This Matter?

If you are reading a data feed and want to turn it into static HTML that you can edit before it goes out, you want to use {single braces} around the content that you want to be able to edit as static HTML.

You should use {{double braces}} around dynamic content like ads or sharing links that should render differently for every user.

Top