Agent Signature based on ticket channel | Community
Skip to main content

Agent Signature based on ticket channel

  • October 10, 2018
  • 33 replies
  • 0 views

[VH]13
Hi Community,
 
I’m trying to set an agent signature based on the channel that the ticket came from.
 
I know that there’s no way to check for channels with Liquid Markup, but I was hoping there would be a way to look if certain ticket fields are filled in. I would set these ticket fields via triggers beforehand.
 
This is the code I tried to use without any luck:
 
{% case ticket.ticket_field_option_title_ 360009740214 %}
{% when 'dmeme' %}
{{agent.signature}}
{% when 'dcoco' %}
{% else %}
{% endcase %}
 
I also tried looking for tags but had no luck with that either.
 
Is it that the Liquid Markup cannot look for ticket data in the agent signature?
 
Looking forward to hearing from you,
Dominic

33 replies

  • October 10, 2018

Hey Dominic,

check out the free app I've built some time ago

https://www.zendesk.com/apps/support/zignatures/

Designed to address this particular use case.


[VH]13
  • Author
  • October 10, 2018

Hi Andrey,

Many thanks for the quick response!

Just to confirm, there's no way we can automate directly from the agent signature?

Reason for asking is because the app seem to need to be manually activated/deactivated and not based on ticket channels how we ideally need it.

Looking forward to hearing from you,
Dominic

 

 

 


  • October 10, 2018

Agent signature ignores ticket object as it's contexted to the current Agent only. So you can' access ticket fields and other attributes from the signature.

BUT, in Zignagtures you can create liquid like

IF this is right channel inject signature {{SIGNATURE}} ELSE inject empty string. 

So the app will still run, but there will be no signature text.

Basically, it's Liquid exercise at the end of the day....


[VH]13
  • Author
  • October 10, 2018

Hi Andrey,

I'm using the following code in the app configuration:

{% if ticket.via == 'mail' %}
{{dc.agent_signature}}
{% else %}
{% endif %}

But it's not working. Any idea what I'm doing wrong? Sorry for all the questions. Your input is much appreciated.

Best,
Dominic


  • October 10, 2018

Try that

 

{% if ticket.via == "Mail" %} SIGNATURE {% else %} no signature {% endif %}


[VH]13
  • Author
  • October 10, 2018

Tried it the exact way you wrote it and it says this:

Liquid Liquid error: Unknown operator =

 

 

 


  • October 10, 2018

When you copy things from here some invisible chars can be added

So copy this

{% if ticket.via == "Mail" %} SIGNATURE {% else %} no signature {% endif %}

Remove formatting (for example copy into browser address bar > the select and copy again)

Try on a ticket.


[VH]13
  • Author
  • October 10, 2018

All good, many thanks for your help, Andrey!

You're a champ!

Cheers,

Dominic


  • October 10, 2018

Make sure you provided feedback to the app!


[VH]13
  • Author
  • October 10, 2018

Done!


[VH]13
  • Author
  • October 19, 2018

Hi Andrey,

Sorry to reach out with this. I'm stuck again. 

I need to create a condition along these lines:

- if a ticket comes in via email, display a message.

- If the ticket requester is part of a certain org, don't display anything

- If the ticket is coming via other channels, also don't display anything.

Code I wrote is this:

{% if ticket.via == “Mail” %}{{dc.agent_signature}}{% elseif user.organization.name == “InsidersOrganization” %}{% else %}{% endif %}

 

It doesn't work.

What am I doing wrong?

 

Looking forward to hearing from you,
Dominic


[VH]13
  • Author
  • October 22, 2018

No ideas? 😔


[VH]13
  • Author
  • October 22, 2018

Hi Andrey,

Alright, I'm trying an easier approach

I will assign a ticket via a trigger that will put a tag "email_signature"

{% if {ticket.tags} contains 'email_signature' %}{{dc.agent_signature}}{% else %}{% endif %}

This does not seem to work either. What am I doing wrong?

Looking forward to hearing from you,
Dominic


  • October 23, 2018

Check these out:

// 1

{% assign via = ticket.via | downcase | strip %}{% if via == 'mail' %}this is MAAAAAIL!{% endif %}

// 2

{% if ticket.tags contains 'customer' %}TAG IS THEEEERE!{% endif %}


[VH]13
  • Author
  • October 24, 2018

Many thanks, the second one worked 🎉 🤜


  • May 5, 2020

Hey Andrey,

 

thank you for the explanation. I would like to do the same as Dominic. But i dont seem to find out, where i can change the liquid or create liquid. Can you help me out with that? Im no coding expert or anything. Do i have to put these statements into the text or html field of the configuration window? 

 

Greetings,
Bastian


  • May 5, 2020

hi Bastian,

all these "liquid" goes into Zignatures App setting together with text or HTML you want to see in the signature. So if you go to MANAGE > Apps > Zignatures and find the settings for this app you should see the field where to add your desired signature code.

Let me know if that helps?


  • May 16, 2020

Hi Andrey,

Very helpful chain here!

We are trying to use Zignature and are having issues with the coding, though I'm not sure what's wrong. We're trying to allow for using multiple signatures to be applied dynamically based on tags on tickets - and in one case, send no signature.

It seems we can get the coding to work here:

{% if ticket.tags contains 'twiliotext' %}
{%- else -%}
<p>Fresh wishes,</p>
<h3>{{current_user.name}} [{{ticket.account}}]</h3>
<p><i>Freshly Customer Experience</i></p><a href="https://www.freshly.com/contact" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/t609Lt9.jpg" alt="Visit us at Freshly.com!"></a></span>
{% endif %}
 
But when we try to make it more elaborate, the logic doesn't work (such as if I tried to add the tag "deliverysupport", I get the last signature option below):
 
{% if ticket.tags contains 'twiliotext' %}
{% elsif ticket.tags contains ‘standardtext' %}
{% elsif ticket.tags contains ‘messagebird' %}
{% elsif ticket.tags contains ‘deliverysupport' %}
<p>Fresh wishes,</p>
<h3>{{current_user.name}} [{{ticket.account}}]</h3>
<p><i>Freshly Customer Experience</i></p>
<br />
 <a href="https://support.freshly.com/hc/en-us/categories/115001757948-Delivery-Shipping" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/GQu00A7.jpg" alt="Visit us at Freshly.com!"></a></span>
{% elsif ticket.tags contains ‘freshlyplus' %}
<p>Fresh wishes,</p>
<h3>{{current_user.name}} [{{ticket.account}}]</h3>
<p><i>Freshly Customer Experience</i></p>
<br />
 <a href="https://www.freshly.com/contact" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/UZbvvPM.jpg" alt="Visit us at Freshly.com!"></a></span>
{%- else -%}
<p>Fresh wishes,</p>
<h3>{{current_user.name}} [{{ticket.account}}]</h3>
<p><i>Freshly Customer Experience</i></p>
<br />
 <a href="https://www.freshly.com/contact" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/t609Lt9.jpg" alt="Visit us at Freshly.com!"></a></span>
{% endif %}

All my best,

Colin


  • May 18, 2020

Hi Colin,

I played a bit and the following version started to work for me.

NOTE: i changed one condition to look up "priority_changed" tag on my test account and slightly updated the HTML

Let me know if that work?

<br>
{% if ticket.tags contains 'twiliotext' %}
{% elsif ticket.tags contains 'standardtext' %}
{% elsif ticket.tags contains 'messagebird' %}
{% elsif ticket.tags contains 'priority_changed' %}
Fresh wishes,<br><b>{{current_user.name}} [{{ticket.account}}]</b><br><i>Freshly Customer Experience</i><br><a href="https://support.freshly.com/hc/en-us/categories/115001757948-Delivery-Shipping" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/GQu00A7.jpg" alt="Visit us at Freshly.com!"></a>
{% elsif ticket.tags contains 'freshlyplus' %}
Fresh wishes,<br><b>{{current_user.name}} [{{ticket.account}}]</b><i>Freshly Customer Experience</i><br><a href="https://www.freshly.com/contact" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/UZbvvPM.jpg" alt="Visit us at Freshly.com!"></a>
{% else %}
Fresh wishes,<br><b>{{current_user.name}} [{{ticket.account}}]</b><i>Freshly Customer Experience</i><br><a href="https://www.freshly.com/contact" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/t609Lt9.jpg" alt="Visit us at Freshly.com!"></a>
{% endif %}


  • May 19, 2020

Hi Andrey,

Thanks, that does help!!

What would you recommend coding-wise for making the current_user_name more prominent?

Can I use a standard header tag?

All my best,

Colin


  • May 19, 2020

You can use any style/HTML supported by Zendesk Comment Editor.

Looks like the Headers are supported. So this is something I expect you can use.

As a test you can create a comment with all possible formatting options and then using dev tool inspect the element to see with HTML is being used by Zendesk. Then use the same HTML in your Zignatures config.


  • May 22, 2020

Hi Andrey,

Thanks, you have been super helpful... so very much appreciated!

One last question, if you don't mind...

What would you recommend if I only wanted to trigger a signature if two tags were on the same ticket, as opposed to one?

Example:

{% elsif ticket.tags contains 'test' and 'test' %}

Fresh wishes,<br><b>{{current_user.name}} [{{ticket.account}}]</b><br><i>Freshly Customer Experience</i><br><a href="https://support.freshly.com/hc/en-us/categories/115001757948-Delivery-Shipping" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/GQu00A7.jpg" alt="Visit us at Freshly.com!"></a>

{% elsif ticket.tags contains 'test' %}

Fresh wishes,<br><b>{{current_user.name}} [{{ticket.account}}]</b><i>Freshly Customer Experience</i><br><a href="https://www.freshly.com/contact" rel="noreferrer" target="_blank"><img src="https://i.imgur.com/UZbvvPM.jpg" alt="Visit us at Freshly.com!"></a>

...where, if 'test' and 'test2' are both on a ticket, Signature A is added, but, if only 'test' is on a ticket, Signature B is added.

All my best,

Colin


  • May 22, 2020

Hi Colin,

Glad your are finding this helpful. Would be great if you can rate this app on Zendesk marketplace.

In liquid you can use AND or OR operators inside the IF statement in the following way:

{% if ticket.tags contains 'test' and ticket.tags contains 'blah' %}
then show me that message
{% endif %}

So if you structure your conditions from more specific (when multiple tags are expected) to a less specific (when one or no tags are expected) it should do the trick.


Tamir13
  • June 18, 2020

Hi Andrey,

I'm trying to run this:

{% if ticket.via == 'Any_channel' %}
{% else %}
{{agent.name}}
{% endif %}

To prevent signatures on Channel integrations, but its not working

 


  • June 19, 2020

@Tamir Bashkin

Interesting...

Can you render {{ticket.via}} placeholder on a ticket (inject it as a text > submit a ticket) to see what value it renders?