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



image avatar

Aimee Spanier

Zendesk Documentation Team

Edited Dec 20, 2024


6

12

13 comments

Late response, 4610403076762 but maybe {{comment.value_rich}} works for you?

0


上記ありがとうございます。大変助かります。

 

ご確認いただきました通り、下記設定を行っており、10MB未満のファイルの場合は、メール添付形式で、送信先に着信をしていることを確認しています。

(10MBを超える場合は、その他の10MB未満のファイルがあっても、全て、添付ファイルもURLリンクも存在しないことを確認しました)

{% for comment in ticket.comments limit:1 offset:0 %}
{{comment.value_rich}}
{% endfor %}

 

 

ご指摘を踏まえ、下記へ変更し、同様のテストを行いましたが、先の現象と同様となってしましました。

 

{% for comment in ticket.comments limit:1 offset:0 %}

{{comment.value_rich}}

{% endfor %}

{% for attachment in comment.attachments %}

{{attachment.url}}

{% endfor %}

 

10MB以上のファイルを添付した場合のみ、添付ファイルが添付されない現象が発生していることから、この観点で、調査や対策について、ご教授いただくことは可能でしょうか?

 

なお、当該テストを行ったチケットは、下記となります。

https://nomura-office.zendesk.com/agent/tickets/519

以上、お手数をおかけしますが、よろしくお願いいたします。

0


Hi, I think I wasn't clear in my last comment.

In sted of {{comment.value}} I need something like {{ticket.comment_html_body}}

This way, it is formatted correctly and will display images and more.

how do I do this?

1


1263213596549 
It works at the beginning, but when the end user replied, it still shows the Fixed name, and the content all mixed together, 
the below is what i had 


{% for comment in ticket.comments %}
<hr/>
{{#if author.agent}}
<b>Fix Name</b>
{{else}}
{{author.name}}
{{/if}}
<span style="color: #999999;"> {{comment.created_at_with_time}}<br /></span>
{{comment.value}}

{% endfor %}
 

0


Hey Vicky, have you tried like:

 

{{#if author.agent}}

fixed name

{{else}}

 {{author.name}}

{{/if}}

 

0


im trying to change the {{comment.author.name}}, if the author is an agent, it would be a fix name, but when its an end user it would be as their name on zendesk, if there a way to do it ? 

0


1265703613369  MS Copilot said this about your question. 

Sure, I can help with that. If you only want to include the URLs for all the attachments in public comments and not the comments themselves, you can modify your code to look like this:

{% for comment in ticket.comments %}
  {% for attachment in comment.attachments %}
    {{attachment.url}}
  {% endfor %}
{% endfor %}

This will loop through all the comments and their attachments, but only print out the URLs of the attachments. It will not print out any information about the comments themselves or any attachments without a URL. This should give you a cleaner output with only the information you want.

0


Hello Carly,

You may want to check this article on how you can customize your email template: Customizing your email templates for notifications
 

0


Hi,

And thanks for the article.

Is there a way to pass the text so it is formatted like a ticket and not just text?

I am creating a forwarding email and would like to replicate the ticket but send it to a different requester.

0


Hi there, Aimee Spanier

 

Is there a way to clean up this markup 

{% for comment in ticket.comments %}

 

Comment:

{{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 %}

 

to only include the URL's for all the attachments in public comments but not the comments? The above returns all comments without an attachment as well and I'm having trouble editing it. 

Thanks!

 

1


Sign in to leave a comment.