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

Conditional statement formatting

The basic format 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}

You can setup multiple IF/THEN statements to account for the different options, and only what your booker selected will be displayed in the email and SMS. 

If there are only 2 options, you can 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. 

Your booker will only see what comes after the {THEN} or {ELSE}

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

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

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

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. 

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. 

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}

{IF}{TERMS}{EQUALS}yes{THEN}Thank you to agreeing to our terms of service. Here is a [link](https://oursite.com/terms) to our terms for your reference{ELSE}Agreeing to our terms of service is a requirement to continuing a business relationship. Please reply to this email confirm you agree with our terms, or your booking may be cancelled.{ENDIF}


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, 2021.

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

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. There are no spaces after the EQUALS and the team member name. 

{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).