Advanced email templates

Note: This is an advanced article! Advanced customers can take greater control over the email templates in Content Snare. We use Liquid templates. This makes it simple to add conditional content to your emails, for example: {% if request.name contains "Website" %} This will be displayed only if the request name contains the word "Website" {% endif %} To learn how conditionals work in Liquid, read this documentation. You can see what operators you can use here. The Truthy rules can be used to create a condition like this, that will only display if a PIN code exists on the request. {%- if request.share_passcode -%} The passcode required to access the link: {{request.share_passcode}} {%- endif -%} Note: This block has a hyphen in the tag, like {%- and -%}. This ensure that no extra whitespace, like a paragraph is added. Here’s another example that would display the text only if the client has completed less than 20% of their request. {% assign percent = request.completion_percentage | ceil %} {% if percent_number < 20 %} This will be displayed only if the request is less than 20% complete {% else %} 20% complete or more {% endif %} In this example, our completion percentage variable is text that includes the percentage sign (e.g. 25%) – the “ceil” filter converts this to a number so we can use it with the < operator. Liquid Variables & Objects When writing your templates, here is a list of the objects & variables available to you. Note, some of the below contain filters, which change the output of each variable. For example, the lines where you can see “img_tag” convert the image URL into a HTML image tag. All of these are text types. Description Variable Current Date now | date Your Company Name company.name Your Company Contact company.contact Your Company Image company.image | img_tag Your Company Image URL company.image Request Owner Full Name owner.contact Request Owner First Name owner.contact_first_name Request Owner Last Name owner.contact_last_name Request Owner Email owner.email Request Owner Image owner.image | img_tag Request Owner URL owner.image Request % Completed (includes % sign) request.completion_percentage Request Days Remaining request.days_remaining Client Company Name client.company_name Client Contact Full Name client.contact Client Contact First Name client.contact_first_name Client Contact Last Name client.contact_last_name Client Email client.email Client Image client.image | img_tag Client Image URL client.image Folder Name folder.name Request Name request.name Request Link URL request.link | link_to: request.link Request Link Button Click here to access | button_to: request.link Request Share Pin Code request.share_passcode Request Due Date request.due_date Client Password Reset Link request.password_update_link | link_to: request.password_update_link Plus these boolean values:
Was this article helpful?

Still puzzling over something?

The agent has read this article — and everything around it. Ask a follow-up and it answers in seconds.