Using Liquid markup to customize the formatting and placement of text in comments and email notifications

Have more questions? Submit a request

6 Comments

  • Vladan Jovic

    Huh, this article helped me a lot! Thank you, Aimee!

    0
  • Dan Ross

    can this be used in a Trigger to extract a comment.id, then send that ID to an external target, using the Notify Target functionality?

     

    Thanks!

    0
  • Albert Llongueras

    Hi, is it possible to use liquid in the master email template?

    1
  • Chris Bulin

    Aimee, I am trying to surface the attachment name and link in the body of a macro. From https://support.zendesk.com/hc/en-us/articles/203662156-Zendesk-placeholders-reference, it's my understanding that I have to do this with Liquid Markup rather than a simple placeholder. Basically, I don't want my agents to have to retype and link the attachment name. I tried this:

     

    But that doesn't seem to work for what I want. Do you have a suggestion for how to do this?

     

    0
  • Kevin Ford

    Hey Dan Ross,

    With some iterative attempts, I figured out how to extract the comment ID. The syntax shown at https://support.zendesk.com/hc/en-us/articles/203662156-Zendesk-placeholders-reference#topic_jkz_opl_rc isn't exactly clear on the fact that the "comment" part of "comment.id" is the name the iterator for the collection. That's probably as clear as mud so here's how to extract the ID in a modification of the article code.

    {% for comment in ticket.comments %}
    
       Comment:
    {{comment.id}} {{comment.created_at}} {{comment.created_at_with_time}} {{comment.author.name}} {{comment.value}} Attachment: {% for attachment in comment.attachments %} {{attachment.filename}} {{attachment.url}} {% endfor %} {% endfor %}

    You don't have to iterate over all of the comments. If you want to get the ID of the latest comment, the Liquid syntax is {{ticket.latest_comment.id}} or if you're after the latest public comment, it's {{ticket.latest_public_comment.id}}. You can use this to fire off to an external target.

    KF

    0
  • Brad Marshall

    Is there any way to get the author's avatar (i.e., comment.author.avatar)?

    0

Please sign in to leave a comment.

Powered by Zendesk