Using Conditional Statements

Conditional statements help you customize your confirmation and reminder emails to booker, as well as your SMS and calendar events based on information they've provided in the booking process. 

In this article:

Formatting Conditional Statements
Conditional statements with Appointment Types
Conditional statements with Booking form questions
Conditional statements with a Checkbox
Conditional statements with a Date or Day
Conditional statements based on team member booked
Testing your Conditional statements

Conditional statement formatting

The basic format of a conditional statement is:

{IF}{xxx}{EQUALS}yyy{THEN}aaa{ENDIF}

The statement is saying, 'if the answer to that xxx question is yyy, then display aaa.' 

The {xxx} can refer to many things like:

  • A question on your booking form that is tagged with a Shorthand Code
  • an appointment type using the shorthand code {TYPE-NAME}
  • a team member using the shorthand code {TEAM-NAME}
  • A day of the week booked using the shorthand code {START-DAY}
  • Any other shorthand code found in our glossary

You can setup multiple Conditional statements to account for the different options during the booking process, and only what your booker selected will be displayed in the email and SMS. 

Only have two options to offer?

Include an {ELSE} statement: {IF}{xxx}{EQUALS}yyy{THEN}aaa{ELSE}bbb{ENDIF}
This statement is saying 'if the answer to xxx question is yyy, display aaa, otherwise display bbb.' 

It isn't possible to include AND or OR in the conditional statements. But you can create more than one statement for each scenario. For example: 

{IF}{START-DAY}{EQUALS}Monday{THEN} I will meet you at the downtown office at 123 Main St.{ENDIF}

{IF}{START-DAY}{EQUALS}Wednesday{THEN} I will meet you at the West Street office at 457 Mulberry St.{ENDIF}

Each individual conditional statement needs to be 'closed' with the tag {ENDIF}.

To format your statements correctly: 
  • Do not add a space between {EQUALS} your text and {THEN}
  • The text between {EQUALS} and {THEN} must match your parameter exactly. If you're using a day of the week, capitalize the first letter
  • Each Conditional statement must start with {IF} and end with {ENDIF}
  • The only condition is {EQUALS} - there is no statement for contains, is less than, or more than.


Using Conditional statements with Appointment Types

You may want to send a different confirmation email depending on which appointment type your booker selects.  

Appointment types are configured under Times & Availability > Appointment Types.

The shorthand code for Appointment Types is {TYPE-NAME}

Under Notifications > Actions > Confirmation Email to the booker create an Conditional statement for each of your appointment types in the body of the email. If you don't create a conditional statement for a certain appointment type, nothing will display in the body of the email when that appointment type is booked. 

A word about the Email Preview

As you're setting up your Conditional statements, the preview window will only display the first appointment type listed on your Appointment Types page because it is just filling in dummy text. In the email received by booker, it will display correctly, based on the appointment type selected. We recommend doing a test booking to see how your booker will see the text.

When your booker receives the email, they will only see the text that displays with the Appointment Type they've chosen:

Using Conditional statements with questions on your booking form

When you setup your booking form, you assign each question a Shorthand code. These are the codes in the curly brackets that populate information based on what your booker enters or selects for that question. 

With multiple choice questions on your booking form, you can build a conditional statement based on the answer they select from the possible options.

When your booker receives the email, they will only see the text that displays information related to the selection they choose on the booking form:

Using Conditional statements with a checkbox

If the question type on your booking form is Checkbox, you can use conditional statements based on if the box is checked or not. The format is:

{IF}{TERMS}{EQUALS}yes{THEN}xxxxx{ELSE}yyyyy{ENDIF}

This statement is saying, 'if the box is checked, then display this text, otherwise display this alternative message.'

If the box is checked " This is a required field" on your booking form, your booker will need to check the box to confirm the booking.

Using Conditional statements with a date or day

You can create conditional statements for a day of the week that is booked, if you are in different location depending on the day:

{IF}{START-DAY}{EQUALS}Monday{THEN} I will meet you at the downtown office at 123 Main St.{ENDIF}

{IF}{START-DAY}{EQUALS}Wednesday{THEN} I will meet you at the West side office at 457 Mulberry St.{ENDIF}

You will need to create a statement for each day you may be in a different location. If you don't create a statement for Thursdays and someone books on Thursday, no additional information will display.

You can also create a statement for a specific date booked, like January 22, 2022 using the shorthand code {START-DATE}.

{IF}{START-DATE}{EQUALS}Friday, January 22, 2022{THEN} Your booking will take place in Conference Room A. {ENDIF}

A word about the Preview window

As you're setting up your Conditional statements, the preview window may not display anything because it is using a dummy day/date to render what your emails will look like. We recommend doing a test booking to see how your booker will see the text.

Conditional statements based on team member booked

The shorthand code for each team member is {TEAM-NAME}.

You can use conditional statements to display information specific to the team member who is receiving the booking. 

In your booking page settings, navigate to Notifications > Actions, and select the email you want to edit, ie Confirmation email to booker. Build out a conditional statement for each team member. 

{IF}{TEAM-NAME}{EQUALS}Mia Martin{THEN}Your meeting will be on Google Meet with Mia with this link: https://whereby.com/mia-martin {ENDIF}
{IF}{TEAM-NAME}{EQUALS}James Darrell{THEN}Your meeting will be on Whereby with James with this link: https://whereby.com/james-room {ENDIF}
{IF}{TEAM-NAME}{EQUALS}Michelle Baylor{THEN}Your meeting will be on GoToMeeting with Michelle with this link: https://GoToMeet.me/MichelleBaylor {ENDIF}

Depending on which team member is booked, that information included in the conditional statement will appear in all confirmation and reminder emails where this set of conditional statements appear.

To make any links clickable within your conditional statements, use the Markdown formatting [your link](your link).

Testing your conditional statements

The booking page preview and notifications preview on the right side of the screen use dummy text to render a "preview" of what your booking pages will look like. 

This can result in the preview being blank for some conditional statements. For example, if you setup a statement using {START-DAY}{EQUALS}Monday and the dummy text in the preview is showing a Friday booking, then nothing will show in the preview. 

To be sure your conditional statements are setup correctly, we recommend making a test booking to see how the text will render, both on the Booking page and in the confirmation email. 

To make a test booking, visit your live booking page by clicking Live booking page on the left hand settings menu, and book a time just like your booker would. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.