osTicket 1.9.x - Email Template Variables

This will be the email template variables (tokens) page for 1.9.1+ (until 2.0). Below is the old list from osTicket 1.8.0+ Email Template Variables, I'll be adding and removing from it over time.

osTicket Template Vars

Client Names VARS
first: %{ticket.name.first}
last: %{ticket.name.last}
lastfirst: %{ticket.name.lastfirst}
short: %{ticket.name.short}
shortformal: %{ticket.name.shortformal}
full: %{ticket.name.full}
original: %{ticket.name.original}
formal: %{ticket.name.formal}
initials: %{ticket.name.initials}
legal: %{ticket.name.legal}

Recipient Vars
name: %{recipient.name}
first name: %{recipient.name.first}
last name: %{recipient.name.last}
lastfirst: %{recipient.name.lastfirst}
short: %{recipient.name.short}
shortformal: %{recipient.name.shortformal}
full: %{recipient.name.full}
original: %{recipient.name.original}
formal: %{recipient.name.formal}
initials: %{recipient.name.initials}
legal: %{recipient.name.legal}
recipients: %{ticket.recipients}
User Access link: %{recipient.ticket_link}
Email: %{recipient.email}

Staff Name VARS
first: %{staff.name.first}
last: %{staff.name.last}
lastfirst: %{staff.name.lastfirst}
short: %{stafff.name.short}
shortformal: %{staff.name.shortformal}
full: %{staff.name.full}
original: %{staff.name.original}
formal: %{staff.name.formal}
initials: %{staff.name.initials}
legal: %{staff.name.legal}

staff name: %{staff.name}
staff first: %{staff.name.first}
staff last: %{staff.name.last}

staff or department signature: %{signature}
Company Name: %{company.name}

Ticket Vars
Ticket ID (internal): %{ticket.id}
Ticket Number (external): %{ticket.number}
Email: %{ticket.email}
From: %{ticket.name}
Phone | Ext: %{ticket.phone}
Priotity: %{ticket.priority}
Subject: %{ticket.subject}
Original ticket body: %{ticket.thread.original}
Submitted: %{ticket.create_date}
Topic: %{ticket.topic.name}
posters name %{poster.name}

Assigned staff and/or team: %{ticket.assigned}
Due Date: %{ticket.due_date}
Date Closed: %{ticket.close_date}

Auth. token used for auto-login: %{ticket.auth_token}
RETIRED Client's ticket view link: %{ticket.client_link} users should upgrade to the token %{recipient.ticket_link}
Staff's ticket view link: %{ticket.staff_link}

OLD Help Topic: %{ticket.topic}
Help Topic: %{ticket.topic.name}

Department: %{ticket.dept}
Department Name: %{ticket.dept.name}
Department Manager Name: ${ticket.dept.manager.name}
Assigned/closing staff: %{ticket.staff}
Assigned/closing team: %{ticket.team}

Other Variables

Incoming message: ${message} [instead of this user comments for assigned note]
To get the last message use: %{ticket.thread.lastmessage}
Outgoing Response: ${response}
name of responder: %{response.poster}
Assign/transfer comments: %{comments}
Assigned staff/team: %{assignee}
Staff assigning ticket: %{assigner}
osTicket base URL (FQDN): %{url}
Password Reset URL: %{reset_link}

Internal Note VARS
OLD Internal Note: %{note}
Note Poster: %{note.poster}
Note Title: %{note.title}
Note Message" %{note.message}

Custom variables, such as those you add via Manage -> Forms can be accessed using the name that you gave them and the prefix the the built in form that you added them to. So if you added a field called Agency that was added to the built in "Ticket Details" you would access it as ticket.agency, aka:

%{ticket.VARIABLE}

Data associated with "Contact Information" is available via %{ticket.user.VARIABLE}. Where VARIABLE is the variable name that you assigned the field in the form. Data associated with other forms (such as extra forms added to help topics) is currently not available this way. It's been this way since 1.8.0.1 iirc.

 

It is important to note that while I have tested many of these, I have not tested all of them. Any labeled as OLD might not work anymore as they appear to have been replaced with new versions. Enjoy!

If you find something wrong with this list please email me at ntozier at osticket dot com and I will update this list when I get a chance. Thanks!

Update 05/22/2015 Forum user Belwi gave me the following to add %{ticket.source} %{response.create_date} %{message.create_date} %{poster.name} %{poster.email}

Update 6/24/2015 Forth coming version 1.10 has a variable type ahead feature which should trivialize this list.

Update 11/16/2015 Forthcoming version 1.10 has a variable that allows emailing attachments to the Agent.  The variable for this is %{message.files}