Zendesk: add HTML to ticket comments with Dynamic Content

Hi, Zendesk users! In this article, we’ll take a look at having HTML in Dynamic Content, in order to have fancier public ticket comments, thus improving your CX capabilities.

Zendesk is a very powerful help desk software that enables your support team to provide excellent customer service, and it comes with a very diverse set of features to help you. In spite of this, we sometimes have a need for some very specific way to support a workflow, which we then realize isn’t built in the product.

Zendesk is versatile enough to let us accomplish these goals, however, allowing us to be as creative as possible, and come up with scalable workarounds.

Enable rich content

Zendesk allows us to choose between markdown and rich content. For this workaround to work, please make sure you enable the latter.

You’ll find it in the Tickets section of your Zendesk settings (/agent/admin/tickets).

A simple but powerful feature (almost mandatory these days), rich content allows you to format and style text, easily add images, and anchored links to your ticket comments.

It does have its limitations, however.

Let’s say we pull customer data via web service to fill several custom ticket fields, and whose placeholder values we use to populate a public comment that we’ll send to our ticket requester.

If we’d like to present this information as a nice HTML table, for example, Zendesk won’t let us do it… at least not in a straightforward way.

This is where our workaround comes in.

1. Custom text field

Create a custom multi-line text field and make sure to grab its field ID.

Let’s name it My HTML content and grab its corresponding ID (in this case, 360000481228).

2. HTML in dynamic content

Let’s create a new dynamic content element, which we’ll name html_example in this tutorial. Its corresponding placeholder is {{dc.html_example}}:

As shown above, we’ve now added our HTML code to our new Dynamic Content element. We can include any additional custom ticket field placeholders, too, whose values we’ll use to populate our HTML table.

3. New macro

Create a new macro whose primary action is to add \{{dc.html_example}} to the ticket comment. Important: make sure to include that backslash before the placeholder.

The downside of this workaround is that we won’t see any HTML when we apply the macro, so let’s keep our fingers crossed and proceed to update the ticket.

If you open the ticket after submitting the update, the content should now appear properly formatted, as intended:

The ticket requester should have received an email with the same HTML design, but don’t just take my word for it, and make sure to test this stuff beforehand, just in case.

There are probably many other ways to play around this workaround (e.g. instead of macros, automating via Extensions » Notify target), so any feedback you’d like to share is really welcome.

Please let me know if this tutorial is unclear, or can’t be replicated.

Leave a Reply

Your email address will not be published. Required fields are marked *