Based on condition, how to change the trigger email body
Hi,
I need to trigger email content based on the number of Beneficiary selected.
For example If beneficiary ===1 then email content should have 1 Primary beneficiary
Primary Beneficiary: {{ticket.ticket_field_12417539333143}}. - {{ticket.ticket_field_12417498387863}}%
If beneficiary ===2 then email content should have Primary beneficiary and Contingent beneficiary.
Primary Beneficiary: {{ticket.ticket_field_12417539333143}}. - {{ticket.ticket_field_12417498387863}}%
[Contingent Beneficiary:] {{ticket.ticket_field_12417508088215}} - {{ticket.ticket_field_12417499000087}}%
and so on.
So my question is how to add if else or Switch condition in the trigger email body?
-
Hello Vishwanath,
You can probably use a case statement with liquid. I have found this helpful article that you may use as a guide: Using Liquid markup to support multiple languages in automations, macros, and triggers
In your trigger, you may add this to the email body so that the content would depend on the value of the field. Just replace the <fieldID> with the correct one.{% case ticket.ticket_field_<fieldID> %} {% when '1' %} case1 {% when '2' %} case2 {% else %} n/a {% endcase %}
-
This will help me. Thanks a lot.
One more question, i have number filed which has 12 digit number. From these fields i need to get last 3 digit in email trigger. Is there way to get it ?
-
Unfortunately, it's not possible to customize the custom field placeholder to only call or show specific digits from the original field value. What I recommend is to create a separate ticket field in which you or your end-users can separately enter this information.
サインインしてコメントを残してください。
3 コメント