User Support
Ticket system for communicating with users
Mail Templates
The plugin sends mail about ticket activity to the user who owns the ticket and to the support staff. The templates can be customized by selecting Mail > Mail Templates from the settings menu.
| Template | Sent to | When |
|---|---|---|
| responsiv.support::mail.new-ticket | Staff | A user submits a ticket. |
| responsiv.support::mail.new-user-message | Staff | The user posts a reply. |
| responsiv.support::mail.ticket-message-updated | Staff | The user edits the ticket or a reply with Minor update unticked. |
| responsiv.support::mail.closed-by-user | Staff | The user closes the ticket. |
| responsiv.support::mail.ticket-assigned | The new assignee | Another administrator assigns the ticket to them. |
| responsiv.support::mail.new-internal-message | Administrators ticked under Notify Users | Staff post an internal message. |
| responsiv.support::mail.new-staff-message | User | Staff post a public reply. |
| responsiv.support::mail.closed-by-staff | User | Staff close the ticket. |
| responsiv.support::mail.closed-by-system | User | The ticket closes automatically. |
Staff Recipients
Staff mail goes to the ticket's assignee. Mail about a new user reply, an edited reply or a ticket the user closed also goes to every administrator who has posted on the ticket, including internal messages. When a ticket has no assignee, staff mail goes to every support member instead. See Support Staff.
The ticket-assigned and new-internal-message templates only go to the recipients listed in the table above.
User Recipients
User mail goes to the email address of the account that owns the ticket. It is skipped when the account no longer exists.
Failed Mail
When a mail cannot be sent, the error is written to the system log, and the ticket or message is still saved. An unreachable staff address does not stop the mail to the other staff.
Layouts
User mail uses the default mail layout, and staff mail uses the system layout. Each view sets its layout and the description shown in the list of mail templates.
Variables
The templates receive the following variables.
| Variable | Description |
|---|---|
ticket |
The ticket. |
ticketMessage |
The message that the mail is about. Mail about the ticket itself, such as new-ticket, receives the ticket. |
user |
The RainLab.User account that owns the ticket, or null when it was deleted. Print the name with user.full_name. |
assignee |
The administrator assigned to the ticket, or null. |
closedUser |
User mail only. The administrator who closed the ticket, or null. |
ticketUrl |
User mail only. The address of the ticket on the primary ticket page, or null when no page uses the Ticket component. |
expireInterval |
The closed-by-staff and closed-by-system templates only. The number of days set by the expireInterval setting. |
previewUrl |
Staff mail only. The address of the ticket in the admin panel. |
staff |
Staff mail only. The administrator receiving the mail. |
otherStaff |
Staff mail only. The signed-in administrator who caused the mail, such as the author of an internal message. |
attachments |
Staff mail only. The files attached to the ticket or message, as an array of file names keyed by their full URL. |
For example, the staff templates list the attachments like this.
{% if attachments %}
<ul>
{% for path, fileName in attachments %}
<li>
<a href="{{ path }}">
{{ fileName }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
Customizing Templates
Open a template in the list of mail templates to change its subject, content or layout. A customized template keeps its own text and layout when the plugin is updated. To return to the plugin's version, click Reset to Default (Delete on October CMS v4.4.0), which discards your changes.
The user variable is a RainLab.User v3 account, which has no name attribute, so print the name with user.full_name. Print names and subjects in the subject line with |raw, as the default templates do, so that a name such as O'Brien is not HTML-escaped.
subject = "User {{ (user ? user.full_name : __('Deleted user'))|raw }} sent a message to the ticket #{{ ticket.id }}"
layout = "system"
==
<p>
Dear {{ staff.first_name }},
</p>
<p>
User {{ user ? user.full_name : __('Deleted user') }} posted a new message to the ticket #{{ ticket.id }}.
</p>
To send the templates in other languages, see Translating Mail Templates.
Previous: Ticket Types Next: Configuration