Back to Notifications Guides

This guide applies to:

  • Basic Edition
  • Plus Edition
  • Pro Edition
  • Business Edition

Introduction

The Notification Subject and Message fields use Twig Code Templates. These help you automatically add in information from each appointment.

This guide will help you personalize your Notifications to make each customer feel like you wrote it specially for them.

And, if you’d like to start with a base message use our Default Notification Templates.


Basic Twig Code Templates to Copy and Paste

The following Twig Code Templates don’t need to be tweaked, just copy and paste them into your notification subject and message.


Customer Name

Collected from the Booking Form Name field:

{{ Appointment.customer_information.Name }}

OR

{{ customer_name }}

Admin Email

Collected from the Admin Email field inside General Settings:

{{ admin_email }}

Appointment Type Name

Collected from the Name field inside Appointment Type Settings > Basics tab:

{{ Appointment.AppointmentType.title }}

Customer Email

Collected from the Booking Form Email field:

{{ Appointment.customer_information.Email }}

OR

{{ customer_email }}

List of All the Customer Information Fields

Collects and lists out all the customer information fields used in the Booking Form:

{{ Appointment.customer_information_summary }}

Appointment Type Instructions

Collected from the Instructions field inside Appointment Type Settings > Basics tab:

{{ Appointment.AppointmentType.instructions }}

Link to Edit, Cancel or Reschedule the Appointment

To send the unique link to edit, cancel or reschedule the appointment, anyone with access to this link can make changes:

{{ Appointment.public_edit_url }}

Appointment Date and Time

Make sure to use the correct timezone for the person who is receiving the message. Even if most of your customers are in your timezone, use the correct Twig Code Template to avoid any confusion.

Admin Timezone:

Start Date:

{{ Appointment.start_date | date("F d, Y g:ia (T)", Appointment.date_timezone) }}

End Date:

{{ Appointment.end_date | date("F d, Y g:ia (T)", Appointment.date_timezone) }}

Customer Timezone:

Start Date:

{{ Appointment.start_date | date("F d, Y g:ia (T)", Appointment.customer_timezone) }}

End Date:

{{ Appointment.end_date | date("F d, Y g:ia (T)", Appointment.customer_timezone) }}

Your Website URL

Go to WordPress DashBoard > Settings > General and look for the URL section.

Go to Settngs > General to find the two URLs

Here you’ll find two URLs, the WordPress Address and Site Address (page you set as the homepage). Sometimes these will both be the same.

To collect and use the WordPress Address URL:

{{ Global.site_url }}

To collect and use the Site Address URL:

 {{ Global.home_url }}

The Customer Booking URL and Page Title

To add in the URL where the customer booked the appointment on:

{{ booking_url }}

To add in the Page title where the customer booked the appointment on:

{{ booking_title }}

Payment Received

If you appointments are setup to accept payments, send the customer the total amount paid for the booking.

{{ Appointment.payment_received }}

Advanced Twig Code Templates

The following Twig Code Templates do need to be tweaked, don’t copy and paste into your notification subject and message until you’ve read the instructions to use them.


Change Payment Received Format

Customize how the currency is displayed in the Payment Received template, by default it looks like this:

{{ Appointment.payment_received }}

We’ll be adding the number_format( ) function to customize the decimal places.

By default, the number_format function on it’s own will return 0 decimal places.

{{ Appointment.payment_received | number_format }}

To make sure your payments are always formatted to 2 decimal places, use the function like this.

{{ Appointment.payment_received | number_format(2) }}

Specific Customer Information Fields

Display a specific customer information field using this Twig Code Template below:

{{ attribute( Appointment.customer_information, 'MYFIELD' ) }}

Replace MYFIELD with the name of your customer information field.

Returning Values in Checkboxes

If your field is a checkbox, you’ll need to use a slightly different format. Since the checkbox field can hold more than one value (array), you’ll need to list all the possible values out using the |join function.

Let’s say for example, you checkbox has 4 possible values: one, two, three, four. If someone selects all four values in the booking form, this is what the different join functions could output.

{{ attribute( Appointment.customer_information, 'MYFIELD' ) | join }}

This join function without any parameters would output: onetwothreefour

There’s no spaces between the values.

{{ attribute( Appointment.customer_information, 'MYFIELD' ) | join(', ') }} 

This join function with a single parameter would output: one, two, three, four

The single parameter lets the values be separated by the same [comma + space] every time. You can separate the values with any characters you want. For example, join(‘~ ‘) would output one ~ two ~ three ~ four.

{{ attribute( Appointment.customer_information, 'MYFIELD' ) | join(', ', ' and ') }} 

And, this code snippet would output: one, two, three and four

The first parameter tells the values to be separated by the [comma + space] for the first values except for the last one. The second parameter denotes the last separation of values, in this case its [space + and + space].

This can also be whatever you’d like, for example, join(‘~ ‘, ‘ $ ‘) would output one ~ two ~ three $ four.


Show Customer Information Only If Filled Out

If statements are used to display Twig Code Templates only if the conditions are met.

For example, you might have an optional customer information field that you only want to show if the customer fills it out.

Use this Twig Code Template to show the field information only if the customer fills it out:

{% if attribute(Appointment.customer_information, 'MYFIELD' %}
MYFIELD: {{ attribute(Appointment.customer_information, 'Westfield' }}
{% endif %}

Replace MYFIELD with the name of your customer information field.


Custom Appointment Date Format

We can customize how the date is formatted for our Appointment Date and Time. This is done using the date( ) function.

For example, this is used to show us the Start Date and Time of our Appointment in the Admin Timezone:

{{ Appointment.start_date | date("F d, Y g:ia (T)", Appointment.customer_timezone) }}

In the Message, this will could look like this: July 01, 2020 2:30 pm (CDT)

That’s because the date( ) function of the Twig Code Template is formatting it: “F d, Y g:ia (T)”

Here’s a key to what each of these letters means:

  • F: The full name of the month (ex. January, February, March)
  • M: The month, three letters (Jan-Dec)
  • d: Day of the month, leading zeroes (01 to 31)
  • j: The day, no leading zeroes (1 – 31)
  • D: The weekday, in three letters (Mon, Tue, Wed)
  • Y: Year, in 4 digits

  • g: 12 hour time format, no leading zeroes
  • G: 24 hour time format, no leading zeroes
  • i: Minutes (00 to 59)
  • a: (am or pm)
  • T: Abbreviated time zone

So, if instead I wanted my date formatted like this: Mon Jul 1, 2020 14:30 CDT

I’d change it to “D M d, Y G:i T” from “F d, Y g:ia (T)”

And my new Twig Code Template would look like this:

{{ Appointment.start_date | date("D M d, Y G:i T", Appointment.customer_timezone) }}

Convert to Uppercase

To convert any of the Twig Code Template outputs to uppercase, add the bit to the end of the statement: | upper

For example, if I wanted the customer name to be uppercase, I’d write:

{{ customer_name | upper }}

Still stuck?

File a support ticket with our five-star support team to get more help.

File a ticket

  • Please provide any information that will be helpful in helping you get your issue fixed. What have you tried already? What results did you expect? What did you get instead?
  • This field is for validation purposes and should be left unchanged.

Related Guides