Variables within automated emails

We use Liquid Markup within our emails to allow variables to be entered inline to our emails. The following are the variables available on automated emails:
Liquid shortcode Description
{{ reservation.title }} Reservation title (Mr. Ms. Miss. Prince, Princess, etc ;)
{{ reservation.first_name }} Reservation first name
{{ reservation.last_name }} Reservation last name
{{ reservation.full_name }} e.g. Duane Hepditch 
{{ reservation.full_name_and_title }} Mr. Duane Hepditch
{% if reservation.title %}{{ reservation.title }} {{ reservation.last_name }}{% else %}{{ reservation.full_name }}{% endif %} Mr. Hepditch if title field is present otherwise Duane Hepditch
{{ reservation.confirmation_number }}
Guest reservation number
{{ }} Guest email address
{{ reservation.suppress_rate }} 'suppress_rate' is a field that we pull from our client's PMS to suppress rates from information for certain reservations  e.g. {% if reservation.suppress_rate == false %} {{ hotel.currency }}{{ reservation.room_revenue }} 

{% endif %}

Read: If the suppress_rate IS false (meaning don't suppress the rate) then display the hotel.currency and room.revenue 

i.e. $999

{{ reservation.check_in }}
{{ reservation.check_in | date: "%s" | minus: 259200 | uri_encode | date: "%A,%e %b %Y" }} Displays the check-in date minus X days. This method pipes the check-in date into Unix time (%s), subtracts the days in epoch time, and pipes it back to our standard date format.  Case use: Hotel Perfect wants to display the actual date the guest must cancel by rather than their generic cancellation window. Cancel by 3 September 2015 vs Cancel within 72hrs of check-in date. Read: This method uses epoch time in the minus equation (86400 = 1 day). To calculate the epoch time based on days, simply multiply 86400 by X number of days. In our example on the left, 86400 × 3 days = 259200.

More info on epoch time including a handy converter here.

{{ reservation.check_out }} Reservation check-out date
{{ reservation.check_in_time }} The check in time as specified in the hotel settings
{{ reservation.check_out_time }} The check out time as specified in the hotel settings
{{ reservation.days_until_check_in }} Number of days until guest check-in
{{ reservation.days_since_check_in }} Number of days since guest check-in
{{ reservation.days_until_check_out }} Number of days until guest check-out
{{ reservation.days_since_check_out }} Number of days since guest check-out
{{ reservation.nights }} Number of nights
{{ reservation.adults }} Total number of adults in the reservation
{{ reservation.children }} Total number of children in the reservation
{{ }} Total number of adults and children in the reservation
{{ reservation.rate? }} '?' means that the drop is a question - Read: Is there a this reservation rate? If yes display X ... If no display Y... 
{{ reservation.first_night_rate }} If separately nightly rates exist, take the first night rate value
{{ reservation.rates }} Array of Rate values  {% for rate in reservation.rates %} 

{{ rate.night | date:"%A, %b %e %Y" }} - {{ rate.amount | currency }} 

{% endfor %}

{{ reservation.average_rate }} Reservation average rate
{{ reservation.room_revenue_total }} Room revenue including tax (GROSS) if reservation.room_revenue_tax 
{{ reservation.room_revenue_tax }}  If no field from PMS for gross revenue to appear - use the following (add standard revenue and tax rate)  {{ reservation.room_revenue | plus:reservation.room_revenue_tax }}
{{ reservation.room_revenue }} Room revenue excluding tax (NET) 
{{ reservation.rate_code }} Reservation rate code
{{ reservation.rate_name }} Note! When assigning this tag, remember that if there exists a rate code not included in the list of rate codes saved to the dashbaord, it will print the rate code.    {% if reservation.rate_description %}{{ reservation.rate_name }}{% endif %} <-- If you'd like to print the rate name, this works ;)  
{{ reservation.source }} Reservation source code
{{ reservation.rate_description }}  Rate code description
{{ reservation.room_code }} Reservation room code
{{ }} Reservation room drop. Searches for a room in the reservation data, i.e. “is there a room in this reservation? If Yes, ‘do X’ if No, ‘do Y'” 
{{ reservation.room_number }} Reservation room number
{{ reservation.room_name }} Reservation room name as it’s entered on the dashboard
{{ reservation.room_description }} Reservation room description as it’s entered on the dashboard
{{ reservation.room_image_url }} The room image URL (must be embedded through an HTML <img> tag)
{{ reservation.room_upgrades? }} Displays eligible room upgrades as entered in the room upgrade paths in the dashboard
{{ reservation.policy_url }}
{{ reservation.policy_description }} Cancellation policy as it’s entered on the dashboard
{{ reservation["Extra Name"] }} Extra values for reservations specific to individual hotels. (The available fields can be found under the list of conditions.) NOTE: Leave the quotes “” in.
{%concierge_url pageName* %} URL to the mobile concierge, *optionally direct to the specific page (pageName should be value after )
It should be only embedded through a HTML <a href="{% concierge_url %}"> tag
{% request_url action-id, requestable-type, requestable-id %} Typically this is "Product" or "RoomUpgrade" for the requestable type, and the ID for that particular item.  Contact us for help.
{{ reservation.market_segment }} Reservation Market Segment
{% unsubscribe_url profile* %} URL to unsubscribe, optionally display profile page before unsubscription
{% survey_url %} standard survey URL
{% survey_url access-code*, locale* %} URL to survey, optionally specify the access-code for a specific survey and/or a locale for language.  Note: Access code is typically the name* of survey. *lower case it and replace spaces with -

e.g. a) {% survey_url , :ar %} = Arabic survey or b) {% survey_url pre-arrival-planner %} = Pre-arrival planner survey c) {% survey_url pre-arrival-planner, :th %} = Pre-arrival-planner + Thai  

{% case reservation.rate_code %}  {% when "RATECODE" %} Insert text here {% when "RATECODE1" or "RATECODE2" or "RATECODE3" %} Insert different text here   {% else %} Insert even more different text here 

{% endcase %} 

If you'd like to display certain text depending on a variable, use this <------ 
{% else %} is not required. So if you'd only like to display wording based on the variables listed, remove {% else %} otherwise keep it in to catch everything else not listed.
{% case {{reservation['Some Extra Value']}} %}  {% when "some value" %}  print something 

{% when "some other value" %} 

print something else 

{% endcase %}

Use case statements for complex text conditions where a separate email step is not suitable.  note that when using an extra value drop in a case tag ensure there are no spaces between the prepending or appending the curly braces   {{reservation['Some Extra Value']}} (good) vs {{ reservation['Some Extra Value'] }} (bad)
reservation.nights {% if reservation.suppress_rate == false and reservation.room_revenue %}{% for rate in reservation.rates %}  {{ rate.night | date:"%A, %b %e %Y" }} {{ hotel.currency }}{{ rate.amount | currency }}{% endfor %}{% endif %} 
{{ hotel.check_in | date: "%I:%M %p" }}  {{ hotel.check_in | date: "%H:%M" }} Check in time (12 hr clock)
Check in time (24 hr clock)

* optional argument 

{{ hotel.website_url }}  Hotel website as it's entered on the dashboard
{{ hotel.instagram_url }}  Hotel Instagram account as it’s entered on the dashboard
{{ hotel.facebook_url }} Hotel Facebook account as it’s entered on the dashboard
{{ hotel.twitter_url }} Hotel Twitter account as it’s entered on the dashboard
{{ hotel.tripadvisor_url }}  Hotel TripAdvisor page as it’s entered on the dashboard
{{ hotel.logo_url }} Hotel logo’s URL