How can I reveal CCs in a notification email using Liquid markup?

Have more questions? Submit a request


  • Eli Webster
    Comment actions Permalink

    If you want them to appear on multiple lines, and you wanted your custom text to only show if there are actual CC's, and you wanted even your own agents to show up as being CC'd, I would do this:

    The first line is just standard "CC E-mail" text. You can remove it if you don't want it.

    You are registered as a CC on this help desk request (#{{}}). Reply to this email to add a comment to the request.

    {% if ticket.cc_names != empty %}
     {% capture ccedusers %}
     {% for cc in ticket.ccs %}
       {{ | prepend: '"' | append: '" '}} {{ | prepend:'<' | append: '>' }}
     {% endfor %}
      {% endcapture %}
    {% if ccedusers contains '@' %}
     Here is where you custom text would go and would only show if there is a CC.

     {{ ccedusers | replace:'&quot','"' | replace:'&lt','<' | replace:'&gt','>' | replace:';','' }}
    {% endif %}
    {% endif %}

    Keep in mind the lines that append and prepend are used for housekeeping. It basically changes something like:

    John Smith


    "John Smith" <>

    which is more in line with standards. And the lines that replace is because I found it sometimes to show the word "&quot" so it changes it to just an actual " sign.

  • Pepijn van de Vondervoort
    Comment actions Permalink

    Thanks Eli.

    Question: when there are no CC'd persons in the ticket, your code is automatically hidden. Thats great!

    But that does leave some unnecessary white space (enters) behind which isn't very neat.

    Is it somehow possible to remove this side-effect?


Please sign in to leave a comment.

Powered by Zendesk