Skip to content

Instantly share code, notes, and snippets.

View armstrjare's full-sized avatar

Jared Armstrong armstrjare

View GitHub Profile
@armstrjare
armstrjare / Notify-requester-of-comment-update.liquid
Last active March 7, 2019 20:55
Zendesk Regular Email Formatting
{% capture newline %}
{% endcapture %}{% capture htmlemail %}{{ ticket.latest_comment_formatted | split:"<table" | size }}{% endcapture %}{% if htmlemail == '1' %}{{ ticket.latest_comment.value }}
{% else %}{{ ticket.latest_comment.formatted_value }}{% endif %}
{% for attachment in ticket.latest_comment.attachments %}
Attachment: {{attachment.filename}} {{attachment.url}}
{% endfor %}
{% if htmlemail == '1' %}
{% for comment in ticket.public_comments %}{% if forloop.index > 1 %}{% capture preline_prefix %}
{% for i in (3..forloop.index) %}>{% endfor %}{% if forloop.index > 2%} {% endif %}{% endcapture %}{{ preline_prefix }}On {{ comment.created_at_with_time | date:'%a, %B %-d, %Y at %-I:%M %p' }}, {{ comment.author.name }} <{{ comment.author.email }}> wrote:{{ preline_prefix }}{% capture line_prefix %}
{% for i in (2..forloop.index) %}>{% endfor %} {% endcapture %}{{ line_prefix }}{{ comment.value | split:newline | join:line_prefix }}{{ line_prefix }}{% endif %}{% endfor %}