Snippet Library
Define a variable once and use it in every snippet, automation condition and task label.
Define a variable once and use it in every message, automation condition and task label on your property. The Snippet Library is a single block of Liquid that HelloShift runs before every snippet, so a rule like "which entrance does this room use?" lives in one place instead of being pasted into every template.
Overview
Availability: the Library tab is enabled per property. Ask us to enable the Library for your property if you do not see it.
Accessing the Library
Go to Guest Messaging > Snippets
Open the Library tab (next to Agreements)

How It Works
The library is one block called _globals. Before any snippet renders, HelloShift runs this block with the guest's data (the same variables a snippet sees: roomNumber, firstName, arrivalDate and so on). Anything the block assigns is then available to the snippet by name.
{%- assign r = roomNumber | split: "," | first | strip | upcase -%}{%- if r == "AP" -%} {%- assign roomEntrance = "Apartment entrance on Rodenberg Street" -%}{%- elsif r contains "1" -%} {%- assign roomEntrance = "Main entrance at Reception" -%}{%- else -%} {%- assign roomEntrance = "Garden entrance around the corner" -%}{%- endif -%}{%- capture signature -%}The Grand Budapest Hotel{%- endcapture -%}With that saved, any snippet can say:
Hi {{firstName}}, your room {{roomNumber}} is ready. Please use the {{roomEntrance}}. {{signature}}And any automation condition can test it:
{% if roomEntrance contains "Garden" %}true{% else %}false{% endif %}Using Library Variables
In snippets: click Insert variable in the snippet editor. Library names appear in their own Library group under the built-in variables.
In conditions: use the name directly in a custom check on a message automation or trigger.
In task labels: room and task automations that build a label from Liquid see the same names.
Copy a token: hover a name in the Defined variables list and click the copy icon to copy
{{name}}.
The Defined variables list shows every name the library defines and how many snippets and conditions use it. Click the count to see exactly which snippets.
Saving and Validation
When you save, HelloShift checks the block before anything goes out:
Syntax errors are reported with the line number, and the line is highlighted in the editor.
Unknown variables (a typo such as
roomNumbr) are rejected.Built-in names cannot be redefined. The library defines new names; assigning
roomNumberorkeyCodeis refused so a message can never silently print the wrong value.{% include %}and{% render %}are not allowed, and the block is limited to 20 KB.
Removing a name: while you type, the tab warns you when a draft drops a name that snippets or conditions still use, with links to each one. After a save that removes a name, the same list appears so you can fix those templates.
Good to Know
Library text is sent as written. Text you write in the library is not translated by guest-language translation yet; keep language-specific wording in the snippet, or branch on
guestLanguage.Keep
{{keyCode}}out of the library. The library runs before every automation check, and a message that prints a door code is held until the key exists (see the door-code note in Guest Automations).Scratch names show up too. Every assigned name (such as
rin the example) is listed; prefix helpers with an underscore if you want them easy to spot.One library per property. Multi-property accounts define a library on each site.
Related Articles
Snippets & Templates - Variables, Liquid and the snippet editor
Guest Automations - Conditions that can use library names
Triggers - Event-driven automations and custom conditions