Drops Reference Guide

A guide to Liquid Drops

Welcome to the JRNI Liquid template reference docs.

JRNI Liquid Templates are based on Shopify's Liquid templating platform. They create dynamic template contents that can be rendered into several different forms on the server.

We use these to create things such as:

  • Emails and SMS
  • PDFs
  • Custom web pages
  • Icals
  • Custom export webhook data
  • CSV Reports

They are extremely flexible, and all major JRNI data objects and most extensible properties are represented. For a basic introduction to Liquid see these helpful guides:

🚧

These docs refer to JRNI Liquid Templates V4 and onwards

If you are not sure what version of Liquid Templates your platform is configured to - please contact your JRNI representative who can help configure this for you

Drop Types

Liquid templates work by using 'Drops' to represent different objects with properties in the system; one drop and links to another drop

There are many different types of Drops:

Using Drops in an email

Certain standard fields are generally available in emails. Although these do vary by email, the most common emails that customers need to customers related to a booking, and as such, the standard objects that are given in the templates are:

  • total - A Representation of an Order Drop
  • company - The company the booking is related to - as a Company Drop
  • extra_data - A set of useful extra data that will depend on the email type as an ExtraData Drop

Pulling out some standard drops is common to ensure you get the right data for the email. For many customers who are just using single appointment and do not need the full complexity of baskets, it is useful to have the following at the top of your email or sms:

{% assign booking = total.printable_items[0].all_spaces.first %}
{% assign slot = space.slot %} 
{% assign client = total.client%}

This gives you the following:

There are a few other useful tags that might help you

Getting the hostname

If you need to know the hostname, it's generally a bad idea to hardcode it in your template. There are two ways to get it:

  • {{company.host}} - valid if you have a company drop
  • {{get_domain}} - always returns the current host domain

Customer Filters

There are multiple custom filters that can help you, some are available in all templates

Date formatting

One of the most common questions is how to best format dates. Most dates are formattable as standard strftime formatted strings, however some dates in the system are passed as proper dates, and some are passed as already rendered string - which means that re-parsing them back into a date format - may mean a loss of timezone and/or daylight saving, which can cause client confusion

{{slot.datetime | date:"%A %e %B %Y"}}
{{slot.datetime | date:"%I:%M%p"}} - {{slot.end_datetime | date:"%I:%M%p"}}