Using placeholders in a macro

Plan requirement

Subscription Any plan
Access Admin

Placeholders put the customer's name, the ticket number or a field value into a macro, so one macro fits every ticket.

Add a placeholder

  1. Edit the macro and put your cursor in the comment.
  2. Type the placeholder, or pick it from the list Zendesk offers.
  3. Save, then apply the macro to a real ticket without submitting, and read what appeared.

That last step is not optional. A placeholder that resolves to nothing looks fine in the editor and produces "Hello ," for the customer.

The ones worth knowing

  • {{ticket.requester.first_name}}. The most used, and the one most likely to be empty for customers who only ever gave an email address.
  • {{ticket.id}}. For giving the customer a reference.
  • {{current_user.name}}. The person updating the ticket now, which is what you want for signing off.
  • Custom field values, written {{ticket.ticket_field_<field ID>}}, and for a drop-down {{ticket.ticket_field_option_title_<field ID>}} when you want the label the customer would recognise rather than the tag behind it.

Two mechanical points that cost people an afternoon. Placeholders are case-sensitive, and a full stop separates the object from its property while underscores join the words inside a name. Typing a space where an underscore belongs is the documented reason a placeholder comes out blank; so is a field ID that does not match the field. Suggestions appear as you type, which is the cheapest way to get both right.

And {{current_user.name}} is not the same as {{ticket.assignee.name}}: the first is whoever is sending this reply, the second is whoever owns the ticket, and on a busy ticket those are regularly different people.

The empty-value problem

Placeholders resolve to nothing when there is no value, and the sentence around them still goes out. "Your order is on its way" is what the customer reads.

Two defences. Write sentences that survive an empty value, or use a Liquid conditional so the sentence only appears when the field has something in it. The second is more work and the right answer for anything customer facing.

Test with a ticket that is missing the data. Placeholders always look right on a well-filled test ticket. The reply that embarrasses you is the one about the customer who never gave their name.

See also

Was this article helpful?

0

Still stuck?

Our support team will take a look with you.

Comments

0 comments

Article is closed for comments.