Template Variables: Difference between revisions

Jump to navigation Jump to search
Lesley (talk | contribs)
No edit summary
Lesley (talk | contribs)
 
(20 intermediate revisions by 5 users not shown)
Line 4: Line 4:
  On this page you find a list of template variables and information on how they are used.  
  On this page you find a list of template variables and information on how they are used.  


These variables (short codes) will be replaced by the relevant information from each booking. They can be used in every text settings that allows their use . Copy them exactly as shown, including the square brackets and upper case.
These variables (short codes) will be replaced by the relevant information from each booking. They can be used in every text settings that allows their use. Copy them exactly as shown, including the square brackets and upper case.


The date variables can have an optional offset value of a number of days added after a colon, for example '''[FIRSTNIGHT:-3 days]'''
The date variables can have an optional offset value of a number of days added after a colon, for example '''[FIRSTNIGHT:-3 days]'''
Line 148: Line 148:
[ROOMID] - room id number
[ROOMID] - room id number


[ROOMNAME] - room names of all booked rooms (not for cancelled bookings use ROOMNAMEINC if used for cacelled bookings)
[ROOMNAME] - room names of all booked rooms (not for cancelled bookings use ROOMNAMEINC if used for cancelled bookings)


[ROOMNAMEBR] - room names with line break
[ROOMNAMEBR] - room names with line break
Line 214: Line 214:
[ROOMTEMPLATE8BR] - ROOM  Template 8  with linkbreak
[ROOMTEMPLATE8BR] - ROOM  Template 8  with linkbreak


[ROOMMETAAUXTEXT] - room meta text setting for first booked room
[ROOMMETAAUXTEXT] - room auxiliary text setting for first booked room {{#fas:cog}} (SETTINGS) PROPERTIES > ROOMS > SETUP > DISPLAY


[ROOMMETAAUXTEXTS] - room meta text setting for all booked rooms
[ROOMMETAAUXTEXTS] - room auxiliary text setting for all booked rooms  


[ROOMMETAAUXTEXTSINC] - room auxiliary text setting for all booked rooms
[ROOMMETAAUXTEXTSINC] - room auxiliary text setting for all booked rooms, incl. cancelled bookings


[INTERNALROOMNAME] - internal room name as used in the control panel, this is not the translated room name shown on the booking page
[INTERNALROOMNAME] - internal room name as used in the control panel, this is not the translated room name shown on the booking page
Line 274: Line 274:
[ROOMCLEANINGFEENUM]  - Cleaning fee from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMCLEANINGFEENUM]  - Cleaning fee from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT


[ROOMSECURITYDEPOSITNUM]  - Securty deposit from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMSECURITYDEPOSITNUM]  - Security deposit from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT


[ROOMTAXPERCENTNUM]  - Tax percentate from from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMTAXPERCENTNUM]  - Tax percentate from from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
Line 572: Line 572:
[BOOKINGIP] - ip address of booker's computer
[BOOKINGIP] - ip address of booker's computer


[APIMESSAGE] - api message sent by originating channel
[APIMESSAGE] - api message sent by originating channel from the Channel Info setting


[BOOKINGDATE] - booking date in guests language
[BOOKINGDATE] - booking date in guests language
Line 672: Line 672:


=== Content from "Mail & Actions" tab ===
=== Content from "Mail & Actions" tab ===
[GUESTEMAIL] - guest's Email address on the "summary" tab of the booking
[GUESTEMAIL] - guest's Email address on the "Mail & Action" tab of the booking


[GUESTLANGUAGE] - guest language
[GUESTLANGUAGE] - guest language
Line 758: Line 758:
[CANCELLEDTIME] - date when the booking was cancelled  
[CANCELLEDTIME] - date when the booking was cancelled  


[CANCELLEDTIME:{%A, %e %B, %Y}] - date when the booking was cancelled display can be any valid PHP strftime format string
[CANCELLEDTIME:{%A, %e %B, %Y}] - date when the booking was cancelled


[CANCELURL] - URL to view and cancel bookings  
[CANCELURL] - URL to view and cancel bookings  
Line 766: Line 766:
[CANCELDATEYYYY-MM-DD] - date until when the booking is cancellable displaying a date. If the date is in the past 00-00-0000 will be shown
[CANCELDATEYYYY-MM-DD] - date until when the booking is cancellable displaying a date. If the date is in the past 00-00-0000 will be shown


[DAYSTOCANCEL] - number of days until booking can be cancelled  
[DAYSTOCANCEL] - number of days from today until booking can no longer be cancelled (Not applicable for OTA bookings)


[CANCELUNTIL] - shows the number of days between check-in and the last day which can be cancelled. If guest can always cancel it shows 0, if guest can never cancel it shows 9999
[CANCELUNTIL] - shows the number of days between check-in and the last day the booking can be cancelled. If guest can always cancel it shows 0, if guest can never cancel it shows 999. (Not applicable for OTA bookings)


[GUESTLOGIN] - URL to view bookings
[GUESTLOGIN] - URL to view bookings
Line 790: Line 790:
[CURRENTDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.
[CURRENTDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[CURRENTTIME] - current time and the display can be any valid PHP strftime format string.
[CURRENTTIME] - current time.


[CURRENTTIME:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.
[CURRENTTIME:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.
Line 818: Line 818:
[BOOKINGDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.
[BOOKINGDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[MODIFYDATE:{%A, %e %B, %Y}] - last booking modification date/time, the display can be any valid PHP strftime format string.
[MODIFYDATE:{%A, %e %B, %Y}] - last booking modification date/time.


[PAYMENTDATE:{%A, %e %B, %Y}] - most recent payment date
[PAYMENTDATE:{%A, %e %B, %Y}] - most recent payment date
Line 833: Line 833:
The following codes can be used in any order between the {} brackets to create custom time and date formats.
The following codes can be used in any order between the {} brackets to create custom time and date formats.


%a An abbreviated textual representation of the day Sun through Sat
    %a An abbreviated textual representation of the day Sun through Sat
%A A full textual representation of the day Sunday through Saturday
    %A A full textual representation of the day Sunday through Saturday
%d Two-digit day of the month (with leading zeros) 01 to 31
    %d Two-digit day of the month (with leading zeros) 01 to 31
%e Day of the month, with a space preceding single digits. 1 to 31
    %e Day of the month, with a space preceding single digits. 1 to 31   
  %j Day of the year, 3 digits with leading zeros 001 to 366
    %u ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
%u ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
    %w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)   
%w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
    %V ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week 01 through 53 (where 53 accounts for an overlapping week)   
  %U Week number of the given year, starting with the first Sunday as the first week 13 (for the 13th full week of the year)
    %b Abbreviated month name, based on the locale Jan through Dec
%V ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week 01 through 53 (where 53 accounts for an overlapping week)
    %B Full month name, based on the locale January through December
  %W A numeric representation of the week of the year, starting with the first Monday as the first week 46 (for the 46th week of the year beginning with a Monday)
    %h Abbreviated month name, based on the locale (an alias of %b) Jan through Dec
%b Abbreviated month name, based on the locale Jan through Dec
    %m Two digit representation of the month 01 (for January) through 12 (for December)   
%B Full month name, based on the locale January through December
    %y Two digit representation of the year Example: 09 for 2009, 79 for 1979
%h Abbreviated month name, based on the locale (an alias of %b) Jan through Dec
    %Y Four digit representation for the year Example: 2038
%m Two digit representation of the month 01 (for January) through 12 (for December)
    %H Two digit representation of the hour in 24-hour format 00 through 23   
%C Two digit representation of the century (year divided by 100, truncated to an integer) 19 for the 20th Century
    %I Two digit representation of the hour in 12-hour format 01 through 12   
  %g Two digit representation of the year going by ISO-8601:1988 standards (see %V) Example: 09 for the week of January 6, 2009
    %M Two digit representation of the minute 00 through 59
%G The full four-digit version of %g Example: 2008 for the week of January 3, 2009
    %p UPPER-CASE 'AM' or 'PM' based on the given time Example: AM for 00:31, PM for 22:23
%y Two digit representation of the year Example: 09 for 2009, 79 for 1979
    %P lower-case 'am' or 'pm' based on the given time Example: am for 00:31, pm for 22:23   
%Y Four digit representation for the year Example: 2038
    %R Same as "%H:%M" Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM
%H Two digit representation of the hour in 24-hour format 00 through 23
    %S Two digit representation of the second 00 through 59   
  %k Hour in 24-hour format, with a space preceding single digits 0 through 23
    %F Same as "%Y-%m-%d" (commonly used in database datestamps) Example: 2009-02-05 for February 5, 2009
%I Two digit representation of the hour in 12-hour format 01 through 12
    %s Unix Epoch Time timestamp (same as the time() function) Example: 305815200 for September 10, 1979 08:40:00 AM   
  %l      (lower-case 'L') Hour in 12-hour format, with a space preceding single digits 1 through 12
    %% A literal percentage character ("%")
%M Two digit representation of the minute 00 through 59
%p UPPER-CASE 'AM' or 'PM' based on the given time Example: AM for 00:31, PM for 22:23
%P lower-case 'am' or 'pm' based on the given time Example: am for 00:31, pm for 22:23
  %r Same as "%I:%M:%S %p" Example: 09:34:17 PM for 21:34:17
%R Same as "%H:%M" Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM
%S Two digit representation of the second 00 through 59
%T Same as "%H:%M:%S" Example: 21:34:17 for 09:34:17 PM
%X Preferred time representation based on locale, without the date Example: 03:59:16 or 15:59:16
%z The time zone offset. Example: -0500 for US Eastern Time
%Z The time zone abbreviation. Example: EST for Eastern Time
  %c Preferred date and time stamp based on locale Example: Tue Feb 5 00:45:10 2009 for February 5, 2009 at 12:45:10 AM
%D Same as "%m/%d/%y" Example: 02/05/09 for February 5, 2009
%F Same as "%Y-%m-%d" (commonly used in database datestamps) Example: 2009-02-05 for February 5, 2009
%s Unix Epoch Time timestamp (same as the time() function) Example: 305815200 for September 10, 1979 08:40:00 AM
  %x Preferred date representation based on locale, without the time Example: 02/05/09 for February 5, 2009
%n A newline character ("\n")
%t A Tab character ("\t")
%% A literal percentage character ("%")


== Booking Group variables ==
== Booking Group variables ==
Line 1,053: Line 1,035:
[INVOICEDATES] - invoice date invoice number if invoicees are involved
[INVOICEDATES] - invoice date invoice number if invoicees are involved


[INVOICEDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.  
[INVOICEDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days.  


[INVOICEDATES:+1day{%A, %e %B, %Y}] - optional date offset and display format - invoice date invoice number if invoicees are involved, The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.  
[INVOICEDATES:+1day{%A, %e %B, %Y}] - optional date offset and display format - invoice date invoice number if invoicees are involved, The offset can be any plus or minus any number of days.  


=== Invoice Values ===
=== Invoice Values ===
Line 1,180: Line 1,162:


[INVOICEPENDPAYNEXTDATE]  - date of the next pending payment
[INVOICEPENDPAYNEXTDATE]  - date of the next pending payment
[INVOICEPENDPAYNEXTDATE:]  - date of the next pending payment display can be any valid PHP strftime format string. Information about PHP strftime Strings can be find found here: http://php.net/manual/de/function.strftime.php


[INVOICEPENDPAYNUM] - all (auto and manual) pending payments including failed but the value is displayed with a decimal point and no thousands separator (for calculation).
[INVOICEPENDPAYNUM] - all (auto and manual) pending payments including failed but the value is displayed with a decimal point and no thousands separator (for calculation).
Line 1,684: Line 1,664:
If you use the multiplier to convert currencies for channels:  For example hotel id 123456 and a multiplier to convert USD to EUR at todays rate:
If you use the multiplier to convert currencies for channels:  For example hotel id 123456 and a multiplier to convert USD to EUR at todays rate:


123456*[CONVERT:USD-EUR]*
123456*[CONVERT:USD-EUR]* then addition of the * at the end will convert the value back to USD when the booking is imported


or this to convert EUR to USD
or this to convert EUR to USD
Line 1,857: Line 1,837:
You want to test if the leaving date is a Sunday and it there is a gap for 1 or more days between the current booking and the next booking.
You want to test if the leaving date is a Sunday and it there is a gap for 1 or more days between the current booking and the next booking.


16. [<span style="color: #019cde">[IF=:[LEAVINGDAY:{%u}]:1:yes|[IF=^[LEAVINGDAY:{%u}]^3</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">]</span>]
16. [<span style="color: #019cde">IF=:[LEAVINGDAY:{%u}]:1:yes|[IF=^[LEAVINGDAY:{%u}]^3</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">]</span>]


You want to test if the leaving date is a Monday or a Wednesday to send a specific message to the guest, for example a reminder that it is bin collection day.
You want to test if the leaving date is a Monday or a Wednesday to send a specific message to the guest, for example a reminder that it is bin collection day.


17. [<span style="color: #019cde">[IF=:[LEAVINGDAY:{%u}]:1:yes|[IF=^[LEAVINGDAY:{%u}]^3^yes][IF=^[LEAVINGDAY:{%u}]^6</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">]</span>]
17. [<span style="color: #019cde">IF=:[LEAVINGDAY:{%u}]:1:yes|[IF=^[LEAVINGDAY:{%u}]^3^yes][IF=^[LEAVINGDAY:{%u}]^6</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">]</span>]


You have different cleaning teams for different days of the week, and you want to send a message to the appropriate team if leaving date is a Monday, Wednesday or Saturday.
You have different cleaning teams for different days of the week, and you want to send a message to the appropriate team if leaving date is a Monday, Wednesday or Saturday.
18. [<span style="color: #019cde">IF<^[AUTHORIZEUNTIL{%Y-%m-%d}]^[CURRENTDATEYYYY-MM-DD]^yes~</span><span style="color: #75d5ad">no</span><span style="color: #fe746c"></span>]
You need to test if the Stripe authorisation has expired before the end of the booking. Then you want to automate the authorisation again . You will require multiple auto actions based on the min/max stay.


== Write out the number in Words. ==
== Write out the number in Words. ==
Line 1,885: Line 1,869:


<span style="color: #f3e504; font-size: 150%;" >{{#fas:lightbulb}} </span>  Always use the template variables ending with NUM if numbers are involved. The math functions will only work with numbers with a decimal point (not a decimal comma) and no thousands separator and no currency symbol.
<span style="color: #f3e504; font-size: 150%;" >{{#fas:lightbulb}} </span>  Always use the template variables ending with NUM if numbers are involved. The math functions will only work with numbers with a decimal point (not a decimal comma) and no thousands separator and no currency symbol.
== Using Template Variables in a HTML editor ==
When using template variables that render tables, such as [INVOICETABLE], do not place them inside <nowiki><p></nowiki> (paragraph) tags. Doing so can lead to formatting issues that affect the table’s appearance.
We recommend inserting the template variable as usual, then clicking the </> Code view button in the editor's toolbar. Then in the code view, locate the template variable and move it outside any surrounding <nowiki><p></nowiki> tags.
For example, if you have this in the editor:
<code>[INVOICETABLE]</code>
You can click the <code>&lt;/&gt;</code> button to see this:
<code>&lt;p&gt;[INVOICETABLE]&lt;/p&gt;</code>
You can fix the formatting issues by changing it to this:
<code>&lt;p&gt;&lt;/p&gt;[INVOICETABLE]</code>