{"id":2196,"date":"2024-03-24T23:06:03","date_gmt":"2024-03-24T23:06:03","guid":{"rendered":"https:\/\/contentsnare.com\/help\/knowledge-base\/advanced-email-templates\/"},"modified":"2025-06-09T13:22:21","modified_gmt":"2025-06-09T13:22:21","slug":"advanced-email-templates","status":"publish","type":"ht_kb","link":"https:\/\/help.contentsnare.com\/knowledge-base\/advanced-email-templates\/","title":{"rendered":"Advanced email templates"},"content":{"rendered":"\n<p><strong>Note: This is an advanced article!<\/strong><\/p>\n\n\n\n<p>Advanced customers can take greater control over the email templates in Content Snare.<\/p>\n\n\n\n<p>We use&nbsp;<a href=\"https:\/\/shopify.github.io\/liquid\/\" target=\"_blank\" rel=\"noreferrer noopener\">Liquid templates<\/a>.<\/p>\n\n\n\n<p>This makes it simple to add conditional content to your emails, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{% if request.name contains \"Website\" %}\n  This will be displayed only if the request name contains the word \"Website\"\n{% endif %}<\/code><\/pre>\n\n\n\n<p>To learn how conditionals work in Liquid, read&nbsp;<a href=\"https:\/\/shopify.github.io\/liquid\/tags\/control-flow\/\" target=\"_blank\" rel=\"noreferrer noopener\">this documentation<\/a>. You can see what operators you can use&nbsp;<a href=\"https:\/\/shopify.github.io\/liquid\/basics\/operators\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>The&nbsp;<a href=\"https:\/\/shopify.github.io\/liquid\/basics\/truthy-and-falsy\/\" target=\"_blank\" rel=\"noreferrer noopener\">Truthy<\/a>&nbsp;rules can be used to create a condition like this, that will only display if a PIN code exists on the request.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{%- if request.share_passcode -%}  \nThe passcode required to access the link: {{request.share_passcode}}   {%- endif -%}<\/code><\/pre>\n\n\n\n<p>Note: This block has a hyphen in the tag, like {%- and -%}. This ensure that&nbsp;<a href=\"https:\/\/shopify.github.io\/liquid\/basics\/whitespace\/\" target=\"_blank\" rel=\"noreferrer noopener\">no extra whitespace<\/a>, like a paragraph is added.<\/p>\n\n\n\n<p>Here\u2019s another example that would display the text only if the client has completed less than 20% of their request.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{% assign percent = request.completion_percentage | ceil %}\n{% if percent_number &lt; 20 %}\n  This will be displayed only if the request is less than 20% complete\n{% else %}\n  20% complete or more\n{% endif %}<\/code><\/pre>\n\n\n\n<p>In this example, our completion percentage variable is text that includes the percentage sign (e.g. 25%) \u2013 the \u201cceil\u201d filter converts this to a number so we can use it with the &lt; operator.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"liquid-variables-objects\">Liquid Variables &amp; Objects<\/h2>\n\n\n\n<p>When writing your templates, here is a list of the objects &amp; variables available to you.<\/p>\n\n\n\n<p>Note, some of the below contain&nbsp;<a href=\"https:\/\/shopify.github.io\/liquid\/basics\/introduction\/#filters\" target=\"_blank\" rel=\"noreferrer noopener\">filters<\/a>, which change the output of each variable. For example, the lines where you can see \u201cimg_tag\u201d convert the image URL into a HTML image tag.<\/p>\n\n\n\n<p>All of these are&nbsp;<strong>text types<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Variable<\/strong><\/td><\/tr><tr><td>Current Date<\/td><td>now | date<\/td><\/tr><tr><td>Your Company Name<\/td><td>company.name<\/td><\/tr><tr><td>Your Company Contact<\/td><td>company.contact<\/td><\/tr><tr><td>Your Company Image<\/td><td>company.image | img_tag<\/td><\/tr><tr><td>Your Company Image URL<\/td><td>company.image<\/td><\/tr><tr><td>Request Owner Full Name<\/td><td>owner.contact<\/td><\/tr><tr><td>Request Owner First Name<\/td><td>owner.contact_first_name<\/td><\/tr><tr><td>Request Owner Last Name<\/td><td>owner.contact_last_name<\/td><\/tr><tr><td>Request Owner Email<\/td><td>owner.email<\/td><\/tr><tr><td>Request Owner Image<\/td><td>owner.image | img_tag<\/td><\/tr><tr><td>Request Owner URL<\/td><td>owner.image<\/td><\/tr><tr><td>Request % Completed (includes % sign)<\/td><td>request.completion_percentage<\/td><\/tr><tr><td>Request Days Remaining<\/td><td>request.days_remaining<\/td><\/tr><tr><td>Client Company Name<\/td><td>client.company_name<\/td><\/tr><tr><td>Client Contact Full Name<\/td><td>client.contact<\/td><\/tr><tr><td>Client Contact First Name<\/td><td>client.contact_first_name<\/td><\/tr><tr><td>Client Contact Last Name<\/td><td>client.contact_last_name<\/td><\/tr><tr><td>Client Email<\/td><td>client.email<\/td><\/tr><tr><td>Client Image<\/td><td>client.image | img_tag<\/td><\/tr><tr><td>Client Image URL<\/td><td>client.image<\/td><\/tr><tr><td>Folder Name<\/td><td>folder.name<\/td><\/tr><tr><td>Request Name<\/td><td>request.name<\/td><\/tr><tr><td>Request Link URL<\/td><td>request.link | link_to: request.link<\/td><\/tr><tr><td>Request Link Button<\/td><td>Click here to access | button_to: request.link<\/td><\/tr><tr><td>Request Share Pin Code<\/td><td>request.share_passcode<\/td><\/tr><tr><td>Request Due Date<\/td><td>request.due_date<\/td><\/tr><tr><td>Client Password Reset Link<\/td><td>request.password_update_link | link_to: request.password_update_link<\/td><\/tr><tr><td>Incomplete Fields<\/td><td>request.incomplete_fields_list<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Plus these&nbsp;<strong>boolean values<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Description<\/strong><\/td><td><strong>Variable<\/strong><\/td><\/tr><tr><td>Request is shared by link (no login needed)<\/td><td>request.is_shared<\/td><\/tr><tr><td>Request requires login and client has not accepted invitation<\/td><td>request.requires_activation<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Note: This is an advanced article! Advanced customers can take greater control over the email templates in Content Snare. We use&nbsp;Liquid templates. This makes it simple to add conditional content to your emails, for example: To learn how conditionals work in Liquid, read&nbsp;this documentation. You can see what operators you&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[1041],"ht-kb-tag":[],"class_list":["post-2196","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-communications"],"_links":{"self":[{"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/ht-kb\/2196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/comments?post=2196"}],"version-history":[{"count":2,"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/ht-kb\/2196\/revisions"}],"predecessor-version":[{"id":2852,"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/ht-kb\/2196\/revisions\/2852"}],"wp:attachment":[{"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/media?parent=2196"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/ht-kb-category?post=2196"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/help.contentsnare.com\/wp-json\/wp\/v2\/ht-kb-tag?post=2196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}