Even better than the ability to add automatic ticket comments with triggers or automations is to make those comments ✨fabulous✨! In this article, we’ll take a look at creating HTML within Dynamic Content placeholders in Zendesk, in order to have better-looking public ticket comments, thus improving our CX communication 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. In this article, we’ll take a look into adding HTML via dynamic content using a macro.

Enable rich content

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

How to enable rich content? You’ll find it on your Admin Center » Objects and rules » Tickets » Settings. Alternatively, open your settings here:

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. We then use these fields’ values to populate the public comment 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.

Custom text field

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

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

Zendesk custom text field for HTML content

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}}:

Zendesk dynamic content with HTML

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.

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.

Zendesk macro with dynamic content HTML placeholder

The downside of this workaround is that we won’t see any HTML when we apply the macro, so let’s proceed and 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 our word for it, and make sure to ⚠️ test this beforehand, just in case ⚠️. Different ticket channels may not render the HTML so, once again, test before using this.

A similar example

Here’s an example of this where we applied something similar to one of our clients’ workflows:

Zendesk automated internal note with HTML table
An automatic internal note with user data rendered as an HTML table (private information omitted).

For the more curious, we’ll sum up this example workflow:

  • The user clicks a link to a prefilled help center form. The URL included specific parameters that will complete hidden fields on the form page. These values will populate agent-facing ticket fields and generate the HTML table.
  • After form submission, a trigger identifies the ticket and adds an automatic internal note using the custom field data acquired thanks for the prefilled form URL
  • The internal note renders an HTML table with useful links to a third-party CRM tool where the agent can quickly access the user information

That’s it! There are probably other ways to achieve this, and other uses as well, so any feedback is very welcome. Feel free to reach out and share your experience… or if you’d like our help to set up fabulous workflows! 😄

article Written by

Pedro Rodrigues, Zendesk and CX consultant

Pedro Rodrigues

Senior Zendesk system administrator and customer-centric project manager dedicated to CX who also contributes as a Zendesk Community Moderator. Experienced in content management & SEO, reporting and analysis. Special skill: an eagle-eye for detail.