Code in Emails and Web/Course Pages

Updated Dec 16, 2024

 Interpolation keys, Liquid objects, and global snippets are powerful components that help you when building dynamic, personalized, and functional content for pages and emails. They dynamically inject data, logic, and reusable templates. 

What are their main differences? 

  • Interpolation keys: Interpolation keys are placeholders that dynamically pull specific pieces of data from your system or database. When rendered, they are replaced by the corresponding value, such as a user’s name, order details, or current date.  They are primarily used in emails. 

  • Liquid objects: Liquid objects are part of the Liquid templating language, which is widely used in platforms for creating dynamic content. They provide flexibility for developers and content creators to manipulate and display dynamic data creatively. They are primarily used in website pages. 


    NOTE!
     As of December 2024, Builder 2.0 is not ready for liquid objects yet.

  • Global snippets: Global snippets are pre-built blocks of reusable code or content that can be inserted across your project. They often include both static and dynamic elements, combining interpolation keys or Liquid objects to ensure the content adapts based on context. Snippets reduce redundancy and improve maintainability by centralizing commonly used layouts or functionalities.

NOTE! For each of the keys in this guide, you need to put brackets around them - like this:

For example…

...and so on 🤓

Interpolation Keys

Interpolation keys will fetch the data in the key and present it on the receiving end for the customer. These are primarily used in Emails.

Contact Related Keys:

  • name: first names

  • firstname: first names

  • lastname: last name

  • fullname: first and last names

  • email: 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

  • manage_url: subscription page

  • ref: affiliate that referred this contact (if the contact is linked to an affiliate of ours)

  • own_ref: affiliate name (when contact is an affiliate of ours, otherwise will show empty)

  • contact_admin_url: contact record admin page

Purchase Related Keys:

  • purchase_url: purchase thank you page

  • edit_purchase_url: manage payment page

  • purchase_id: purchase ID

  • product_id: product ID

  • product_name: product name

  • product_internal_name: product internal name

  • product_key: product internal name - URL paramaterized

  • product_category: product category

  • product_category_key: product category - URL paramaterized

  • quantity: quantity

  • price_name: price name

  • currency_code: currency code

  • coupon_code: coupon code

  • received_price: received price

  • received_tax: received tax

  • received_total: received total

  • incoming_price: incoming price

  • incoming_tax: incoming tax

  • incoming_total: incoming total

  • sales_price: sales price

  • sales_tax: sales tax

  • sales_total: sales total

  • last_charge_tx_id: last charge tax ID

  • last_charge_tx_gateway_id: last charge tax gateway ID

  • company_name: company name system field collected in order forms

  • vat_no: vat number system field collected in order forms

Events Related:

  • event_time: event time

  • event_title: Title of your event
  • event_description: Description of your event
  • event_location: Location of your event
  • event_url: Link to the event
  • organizer_name: organizer name

  • organizer_first_name: organizer first name

  • organizer_email: organizer email

  • link_name: Scheduling link name
  • scheduler_name: scheduler name

  • scheduler_first_name: scheduler first name

  • scheduler_email: scheduler email

Other:

  • 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

Special cases:

Facebook URL fields, telephone fields, and Twitter handle fields all ordinarily output an HTML link. In these cases you will follow the format below:

URL fields:  

 (note the spacing between text and brackets and the "_plain" at the end of the key) 

Liquid Objects 

Liquid is a templating language that allows you to display dynamic content on web pages. So we need this key to be dynamic, because it’s based on a user dynamically visiting a site or a page.

Liquid objects are similar to interpolation keys, except they need to be used for web and course pages specifically.

  • customer: Contact object

  • field: Contact custom fields object

  • global: Global snippets object

  • internal_name: course, product, site, group and worksheet

Common Liquid Objects:
  • customer.first_names: contact’s first name

  • customer.last_name: contact’s last name

  • customer.name: contact’s full name

  • customer.email: contact’s email

  • account.name: your account name

NOTE! Some of these liquid objects can also be used in emails like interpolation keys, but they must be used for web/course pages (interpolation keys will not work for pages).

For the following Liquid Objects, you don’t need to add more brackets around the brackets displayed below:


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.magic li