How to make a macro that will change depending on how the ticket arrived: email or WhatsApp? | Community
Skip to main content

How to make a macro that will change depending on how the ticket arrived: email or WhatsApp?

  • February 9, 2024
  • 2 replies
  • 0 views

Ivan27

Hi there!

I have an active template that I use to work with brands. The answer in the macro varies depending on the brand.

Please help me make a macro in which the content will change depending on where the macro came from: email or WhatsApp.

Answer header:
{% case ticket.via %}
{% when 'mail' %}
Hi {{ticket.requester.first_name}},
{% else %}
Hi {{ticket.requester.first_name}}, it's {{ticket.assignee.first_name}}, Customer Support Manager here
{% endcase %}

Unfortunately, the code only works after "else". Please help me find the error and fix it๐Ÿ™

2 replies

Brandon12
  • February 15, 2024

Hey @Ivan Zabirov

Try this code instead:

{% case ticket.via.channel %}
{% when 'email' %}
Hi {{ticket.requester.first_name}},
{% else %}
Hi {{ticket.requester.first_name}}, it's {{ticket.assignee.first_name}}, Customer Support Manager here
{% endcase %}

Brandon


Antonio17
  • February 15, 2024
Hi Ivan,
it seems like Brandon shared an important adjustment to your loop. Try to use 'email' instead, as the channel's name should be that one.
 
Best,