Skip to content
Start a Free 14-Day Trial

Conditional Logic

Use conditional logic in Apptoto message templates and appointment pages to further customize message templates and appointment pages.

Conditional logic can be used in your message templates and appointment pages to include or exclude certain parts of the message.

Use {% if %} blocks to include or exclude content based on appointment or participant data.

Conditional logic is in the following format:

{% if CONDITION %} CONTENT {% endif %}

or

{% if CONDITION %} CONTENT {% else %} ALTERNATE {% endif %}

or

{% if CONDITION %} CONTENT {% elsif CONDITION2 %} CONTENT2 {% endif %}

If you would like to add a note to your message only when the appointment is in the evening, you could use:

Your appointment is {{ event.day_and_time_phrase }}.
{% if event.time_hour >= 17 %}Please note that the office closes promptly at 6pm.{% endif %}

The “Please note…” sentence will only appear when the appointment starts at 5pm or later.

Conditions are in the format:

FIELD OPERATOR OPERAND

For boolean fields, you can test if a field is true by just putting:

FIELD
OperatorDescription
==Exact equals. For example, for boolean fields, participant.first_appointment_of_the_day true would be true if the appointment was the first appointment of the day. Or event.all_day false would be true if the appointment was not an all-day appointment.
!=Is not equal. For example, participant.confirmed != true would be true if the participant had not confirmed.
>Greater than. Useful for number fields. e.g. if event.time_hour > 12 would be true if the appointment was in the afternoon.
>=Greater than or equal. Useful for number fields.
<Less than. Useful for number fields.
<=Less than or equal. Useful for number fields.
includesString includes a certain word or phrase. e.g. if event.title includes 'rain'. Includes is not case sensitive and only matches whole words (i.e. it would not match “raindrop”, but it would match “time for rain”).
does_not_includeString does not include a certain word or phrase.
containsString contains a certain string. Not case sensitive. Matches any string, even if the string is inside another string. e.g. if event.title contains 'rain' would match “raindrops”.
does_not_containString does not contain a certain string.
starts_withString starts with a specific string. Not case sensitive. If the keyword were pump, it would match the selected field if it were pumpkin.
does_not_start_withString does not start with a specific string. Not case sensitive.
ends_withString ends with a specific string. Not case sensitive. If the keyword here were kin, it would match the selected field if it were pumpkin.
does_not_end_withString does not end with a specific string. Not case sensitive.

Boolean operators and and or can be used to generate complex logic, e.g.:

{% if event.title starts_with 'call:' and event includes 'conference' %}Please use the conference line provided to join the conference.{% endif %}
OperatorDescription
andCondition A and Condition B
orCondition A or Condition B