Category / Section
Sample Liquid Template for If-Else If-Else Chain
1 min read
Updated:
In BoldDesk, you can use Liquid templating language to create dynamic and conditional content within your email notifications. This is especially useful when you want to customize content based on certain ticket properties such as the received email address, ticket type, priority, or custom fields.
This article provides a sample template using an if-elsif-else chain in Liquid, along with a breakdown of how it works.
Customize Based on “Received At” Email Address
{% if ticket.received_at == "support@yourdomain.com" %}
Thank you for contacting our Support Team. We’ve received your request and will respond shortly.
{% elsif ticket.received_at == "billing@yourdomain.com" %}
Thank you for reaching our Billing Department. Your inquiry is important to us and will be reviewed soon.
{% elsif ticket.received_at == "sales@yourdomain.com" %}
Thanks for your interest in our products! Our Sales Team will get back to you as soon as possible.
{% else %}
Thank you for contacting us. We’ve received your request and it is being routed to the appropriate team.
{% endif %}
- Always use == for equality comparisons.
- Liquid is sensitive to syntax—make sure your if, elsif, and else blocks are properly closed with {% endif %}.
- You can extend this logic with other ticket properties like: ticket.status, ticket.priority and ticket.custom_fields.field_name
Related Articles:
How to Use Liquid in BoldDesk to Build Dynamic Conditional Content