Current Lesson
Course Content
Course Content

Code in emails

This guide is still super rough, but we wanted to get it out there while we keep working on it.

Get in touch with your questions or issues.

Interpolations

Insert this string between curly braces, eg. {{interpolation_key}} or {{global.some_key}} or {{field.some_key}}.

  • name: first names
  • firstname: first names
  • lastname: last name
  • fullname: first and last names
  • email
  • ref: affiliate ref string of referring affiliate
  • username: their Simplero ID
  • password: their password, if it was auto-generated by the system. If they changed their password, this will be blank.
  • signup_reminder: reminder of why they signed up
  • subjectprefix: prefix for the subject from the list, product, or affiliate program sent to
  • footer: footer text from the list, product, or affiliate program sent to
  • content_url: link to content for this list subscriber / purchase / participant / affiliate
  • purchase_url: same as content_url
  • manage_url: link to manage their subscription
  • open_image_url: URL of the image we use to track open rates
  • field.(interpolation key) for each custom field with interpolation key set
  • field.(interpolation key)_(subfield) for each custom field with interpolation key set & subfield
  • field_(id) for each custom field
  • field_(id)_(subfield) for each custom field and subfield
  • global.(key) for each global snippet

Liquid objects available

  • customer: Contact object
  • field: Contact custom fields object
  • global: Global snippets object

Global snippets

If you insert a global snippet using {{global.some_key}}, these will be replaced as the very first thing while processing the email.

This means that your snippet can contain other interpolations, or even Liquid code, and those will be evaluated in the exact same way as if you'd typed the contents of your global snippet directly into the email itself.

However, if it contains another global snippet, then that won't be replaced in the same way again. It will work, but it'll be interpreted as a Liquid expression.

Also, if you use the global snippet in a Liquid expression, eg. {{ global.some_key | upcase }}, then we will NOT be evaluating any other interpolations or Liquid code inside that global snippet.

Last updated 29 Apr 2019.