Skip to content

Working with E-mail Templates

The e-mail builder tool lets you go beyond static newsletters by pulling in live data about your customers, their subscriptions, and their orders, and by showing or hiding content based on who’s reading it. This guide walks you through the three building blocks you’ll use to do that: variables, visibility conditions, and tracking, plus a full reference of the objects available to you.


Variables let you insert dynamic content into your e-mail, like a customer’s name or an order total, instead of typing it out by hand. You’ll find them available directly in the e-mail builder tool.

Variables are available in any environment where you send e-mails, including Automations and Social Posts. Automations have access to a larger set of variables, since they’re triggered by specific events (like a form submission or a failed payment) that carry extra context with them.

Some variables are marked as objects below. An object gives you direct, low-level access to all the properties of that record, similar to what you’d get back from the API. Our support team can advise you on using these if you need something more advanced than the flat variables listed below.

Which variables are available depends on the trigger

Section titled “Which variables are available depends on the trigger”
  • Content triggers — when a trigger relates to a specific article:

    • article_id — Article ID / Content ID
  • Customer triggers — available on any trigger with a customer attached, including payment triggers:

    • visitor_id
    • EMAIL
    • FULL_NAME
    • FIRST_NAME
    • LAST_NAME
    • customer
    • code (only on the Forgot your password and Email activation request triggers)
  • Payment triggers — available on any trigger with a payment attached, including subscription triggers:

    • AMOUNT
    • CURRENCY
    • visitor_id
    • subscription_id (if the payment is tied to a subscription)
    • order_id
    • order
    • cart (deprecated)
    • price_matrix['subtotal']
    • price_matrix['shipping']
    • price_matrix['tax']
    • price_matrix['discount']
    • price_matrix['total']
  • Subscription triggers — available on any trigger with a subscription attached:

  • Form triggers — available on triggers related to a form submission:

    • form
    • form_id
    • submission_id
    • form.response — the submitted answers, mapped to the alphanumeric keys defined in your form, e.g. form.response.name and form.response.email
  • E-mail list triggers:

    • channel_id — ID of the Social Channel
    • channel_post_id — available when a Social Post is opened or read
  • Forgot your password / Email activation request triggers:

    • code — the activation code to send along with your API call
  • Nightly renewal triggers:

    • logs — a JSON-encoded array of log messages
    • total — total subscriptions found for renewal
    • success — total subscriptions renewed without errors

Sometimes you only want a piece of content to show up for certain readers, for example a renewal reminder that should only appear for customers without an active subscription. Visibility conditions let you do exactly that: they decide whether a Container or Columns block gets shown to a given customer. If the condition isn’t met, the block is left out of the e-mail entirely — it won’t appear in the e-mail’s source at all.

  1. Select the Container or Columns block you want to control in the e-mail builder.
  2. Find the Visibility condition field in its settings.
  3. Write your condition using Smarty-style scripting, prefixing any variable with a dollar sign $.
  1. Show a block only to customers with an active subscription: $customer.subscriptions|count gt 0

  2. Show a block only to customers located in South Africa: $customer.country_code eq "ZA"

  3. Show a block only to customers who have a profile picture set: $customer.photo neq ''

If you get stuck writing a condition, our support team is happy to help.

Modifiers are Smarty functions you can apply to a variable by adding a | after it, for example variable|count. The two you’ll use most often are:

  • count
  • empty

Use these Smarty operators to compare values in your condition:

Operator Meaning
eq Equal to
neq Not equal to
gt Greater than
lt Less than
gte Greater than or equal to
lte Less than or equal to

To invert any expression, prefix it with !. For example, !($customer.active) is true when the customer is not active.

You can also use functions to check conditions inside arrays or to evaluate a customer’s subscription state.

in_array(16, $customer.tags) is true if the customer has the tag with ID 16 attached to them.

The C:: namespace gives you a set of built-in helpers for common subscription and channel checks, so you don’t have to write out the underlying logic yourself.

Most of these take a group_name argument, which accepts either a single quoted string ('premium') or an array of strings (['basic', 'premium']) if you want to match against any of several groups. The channel_id argument always takes a single quoted string. As with any condition, you can prefix these with ! to invert them.

Function Description
C::hasActiveSubscription($customer, 'group_name') True if the customer has an active subscription in the given group.
C::getActiveSubscriptionPrice($customer, 'group_name') gt 0 True if the customer’s active subscription price in the given group is greater than 0. Replace gt 0 with any comparison to check a specific price.
C::neverSubscribed($customer, 'group_name') True if the customer has never held a subscription in the given group.
C::hasRetryingSubscription($customer, 'group_name') True if the customer has a subscription in the given group that is currently in a payment retry cycle.
C::hasExpiredNotRetryingSubscription($customer, 'group_name') True if the customer has a subscription in the given group that has expired and is no longer retrying payment.
C::cardExpiringThisMonth($customer) True if the customer’s payment card expires in the current month.
C::subscribedToChannel($customer, 'channel_id') True if the customer is subscribed to the given channel.
C::hasTag($customer, 'tag_id') True if the customer has the given tag assigned to them.

Examples

  • Show a block only to customers without an active subscription in the “premium” group: !C::hasActiveSubscription($customer, 'premium')

  • Show a block only to customers whose card is expiring this month: C::cardExpiringThisMonth($customer)

  • Show a block only to customers who have never subscribed to the “basic” group: C::neverSubscribed($customer, 'basic')


Every e-mail you send comes with tracking built in, so you can measure opens and clicks without any extra setup.

  • Opens are tracked automatically using an open tracking pixel embedded in every e-mail.
  • Clicks are tracked automatically too: every link in your e-mail gets tracking parameters appended to it —
    • utm_campaign=Post-{post_id}
    • utm_medium=email
    • utm_source=CMS-{channel_id}

You’ll find this data both in Google Analytics and in the CMS’s own analytics, so you can see how a given e-mail performed in either place.

By default, utm_source is set to CMS-{channel_id}. If you’d rather use a more readable or campaign-specific name, you can override it with a custom string. Go to AdministrationPublisher ConfigurationSocial Channels and update the channel’s settings.

Sometimes you don’t want a link rewritten with tracking parameters, for instance if it’s a deep link that needs to open directly inside a mobile app. In that case, add ?no_redirect=true to the link and it will be left untouched. Note that this will also prevent the system from knowing whether the link was clicked.


The variables marked as objects above (customer, order, subscription, form, and item) give you access to far more detail than the flat variables alone. The structure of each object mirrors what you’d get back from the API, so if you’re already familiar with our API responses, this will look familiar.

For any array property, you can apply the modifiers described above, for example customer.tags|count.

Property Type Notes
customer.id int Unique customer ID
customer.loginName string Login e-mail address
customer.displayName string Full display name
customer.photo string Profile picture URL; empty string when not set
customer.accountType int 0 = social/passwordless account, 1 = has credentials
customer.user_type string e.g. subscriber
customer.active int 1 when the account is active
customer.clientId int Internal client identifier
customer.source string Acquisition source, e.g. organic
Property Type Notes
customer.country_code string ISO 3166-1 alpha-2 country code, e.g. NL
customer.country string Country name
customer.city string City name
customer.mobile string Mobile number in international format
customer.preferredLanguage string BCP 47 language tag, e.g. en
customer.dateOfBirth int Unix timestamp
customer.lastLogin int Unix timestamp of last login
customer.lastLoginCountry int Country ID at last login
Property Type Notes
customer.creationDate int Account creation date as Unix timestamp
customer.creationDay string Day and month of creation in DDMM format, e.g. 0101
customer.registeredSinceCohort string Cohort bucket based on account age: M0, M1-3, M3-6, M6-12, Y1Y10+
customer.payment_expiry int Unix timestamp of the latest payment expiry
customer.maxExpiry int Unix timestamp of the furthest future subscription expiry
customer.minActivation int Unix timestamp of the earliest subscription activation
customer.totalSubscriptionDays int Cumulative active subscription days (rounded up)
customer.archiveCredits int Number of remaining archive credits
Property Type Notes
customer.preferences object Full preferences object
customer.preferences.optout_marketing string "1" if opted out of marketing, "0" otherwise
customer.preferences.optout_marketing_date int Unix timestamp when the opt-out was recorded; 0 if not set
customer.preferences.country_code string Country code stored in preferences
Property Type Notes
customer.address.street string Street and house number
customer.address.city string City
customer.address.postalCode string Postal / ZIP code
customer.address.country string ISO country code
Property Type Notes
customer.properties object Key-value pairs of custom fields set on the account
Property Type Notes
customer.payment object Latest payment; may be absent if no payments exist
customer.payment.id int Payment ID
customer.payment.status string e.g. completed
customer.payment.price string Amount as a decimal string
customer.payment.currency string ISO 4217 currency code, e.g. EUR
customer.payment.price_baseCurrency string Amount in the account’s base currency
customer.payment_tokens object Stored payment tokens keyed by provider name (e.g. stripe); only present when a token is on file
customer.payment_tokens.{provider}.token string Provider token
customer.payment_tokens.{provider}.guid string Internal GUID
customer.payment_tokens.{provider}.expiry string Card expiry date
customer.payment_tokens.{provider}.lastdigits string Last 4 digits of the card
customer.payment_tokens.{provider}.payment_method string e.g. card
Property Type Notes
customer.tags int[] Array of tag IDs assigned to the customer
customer.tags[n] int ID of a single tag
Property Type Notes
customer.subscriptions array All subscriptions on the account
customer.subscriptions[n].id int Subscription ID
customer.subscriptions[n].activationDate int Unix timestamp
customer.subscriptions[n].deactivationDate int Unix timestamp; 0 if still active
customer.subscriptions[n].status int 1 = active
customer.subscriptions[n].product int Product ID
customer.subscriptions[n].group string Subscription group name
customer.subscriptions[n].paymentMethod string e.g. stripe
customer.subscriptions[n].nextRenewal int Unix timestamp of next renewal
customer.subscriptions[n].cancellationRequestDate int Unix timestamp; 0 if no cancellation requested
Property Type Notes
customer.channels int[] IDs of channels the customer is subscribed to
customer.channels_optout int[] IDs of channels where the customer has opted out or is inactive
customer.channels_timestamps_cohort object Cohort string keyed by channel ID indicating when the customer subscribed, e.g. { "1": "Y1" }
customer.channels_details array Detailed subscription info per channel
customer.channels_details[n].channelId int Channel ID
customer.channels_details[n].optout int 1 if opted out
customer.channels_details[n].active int 1 if active
customer.channels_details[n].timestamp int Unix timestamp of subscription
customer.channels_details[n].optout_timestamp int Unix timestamp of opt-out; 0 if not opted out
Property Type Notes
customer.read_posts int[] IDs of posts the customer has opened
customer.click_posts int[] IDs of posts the customer has clicked
customer.read_time object Unix timestamp of last open per channel ID, e.g. { "1": 1718700000 }
customer.click_time object Unix timestamp of last click per channel ID
  • order.id
  • order.price
  • order.status
  • order.responseMessage
  • order.lastUpdate
  • order.timestamp
  • order.userId
  • order.paymentMethod
  • order.cart (deprecated)
  • order.price_matrix
  • order.price_matrix.subtotal
  • order.price_matrix.tax
  • order.price_matrix.discount
  • order.price_matrix.shipping
  • order.price_matrix.total
  • order.items_details (array)
  • order.items_details[n].item
  • order.items_details[n].price
  • order.items_details[n].quantity
  • order.items_details[n].item.description
  • order.shippingStatus
  • order.authorization
  • order.address
  • order.shipping_address
  • order.shipping_price
  • order.tax_price

Inside a Container or Columns block whose data source is set to Product Items, you can use the following variables:

  • item.price
  • item.quantity
  • item.item.description
  • subscription.id
  • subscription.activationDate
  • subscription.deactivationDate
  • subscription.status
  • subscription.product
  • subscription.product.description
  • subscription.purchased_item
  • subscription.purchased_item.name
  • subscription.nextRenewal
  • subscription.lastFailedOrder
  • subscription.attempts
  • subscription.referenceOrderId
  • subscription.group
  • subscription.group_name
  • subscription.paymentMethod

Available for automations linked to a form submission.

Property Type Notes
form.id int Unique form ID
form.name string Form name
form.fields array Field definitions for the form
form.captcha_enabled bool Whether CAPTCHA is enabled on the form
form.allow_anonymous bool Whether anonymous submissions are permitted
form.response object Key-value pairs mapping each field’s alphanumeric key to the answer provided by the user

form.response contains one entry per form field, keyed by the field’s alphanumeric identifier. For example, if your form has fields with keys name and email, you’d reference them as form.response.name and form.response.email.


If you have any questions or need further assistance, feel free to reach out to the support team for help.