Things you must know before starting
You will find a good and complete documentation about Liquid for Designers here.
The variable names should consist of alphanumeric characters and underscores, should always start with a letter, and do not have any kind of leading sigil (that is, they look like, var_name
not $var_name
).
If you are stuck with your notifications or lacking technical skills, our team can create notifications for an extra fee. Please feel free to reach us at support@bookingsync.com with an example of what you need in Word or PDF file and we'll send you the corresponding quote.
Expected check-in time instead of default check-in time
{% if booking.expected_checkin_time == blank %} {{booking.start_at | date: "%l.%M %p" }} {% else %} {{booking.expected_checkin_time | date: "%l.%M %p"}} {% endif %}
The date format can be adapted. Please check this source for other variations of time usage.
Example:
<p>We are pleased to welcome you at {% if booking.expected_checkin_time == blank %} {{booking.start_at | date: "%l.%M %p" }} {% else %} {{booking.expected_checkin_time | date: "%l.%M %p"} {% endif %} on {{booking.start_at | date: "%A %e of %B" }}. </p>
the output message will be:
We are pleased to welcome you at 12.00 PM on Monday 23 of January.
where 12.00 PM is the expected check-in time if there is any or the default one.
First name of the guest instead of the full name
If you want to use the first name of the guest instead of the full name, provided in BookingSync, you can copy and paste this snippet to your notifications and then use {{first_name}}
{% assign names = guest.fullname | split:" " %} {% assign first_name = names.first %} <p>Dear {{first_name}},</p>
the following name will be displayed, if "Zenon Martyniuk" is the full name in BookingSync
Dear Zenon
First name + last name(s) of the guest
If you want to split the first and the last name of the guest and be sure to get the full name (i.e. if the guest has 2 last names like John Taylor Smith), you can copy and paste this snippet to your notifications and then use {{first_name}}
and {{last_name}}
.
{% assign names = guest.fullname | split:" " %} {% assign first_name = names.first %} {% assign last_name = guest.fullname | remove: first_name%} <p>Guest name: {{last_name}} {{first_name}}</p>
if "Zenon Martyniuk" is the full name in BookingSync the following line will be displayed:
Guest name: Zenon Martyniuk
Add or subtract time to a date/time
If you want to add or subtract time to a dynamic date, you can convert the date in seconds, add (plus:) or subtract (minus:) the amount of time in seconds and convert back in time or date.
Code:
{{booking.expected_checkin_time | date: "%s" | minus: 7200 | date: format: "time"}}
The output number will be: 10:00 if the check-in time is 12:00
Manage the discounts
In BookingSync, you can either set a discount in percentage or amount. The following code will output the discount amount.
{% assign discount_amount = 0 %} {% if booking.discount.last == "%" %} {% assign discount_percentage = booking.discount | remove: "%" %} {% assign discount_amount = booking.initial_price | times: discount_percentage | divided_by: 100 %} {% else %}<br>{% assign discount_amount = booking.initial_price | times: booking.discount | divided_by: 100 %} {% endif %}
Then, use the variable {{ discount_amount }}
to display the correct amount.
Comments
0 comments
Please sign in to leave a comment.