Skip to main content

How to customize the email template

To change the email template of the Helpdesk, follow these steps:

  1. Go to Marketing -> Email templates.

  2. Press the Add new template button.

  3. In the dropdown list, select the template that you would like to customize. The current extension templates are listed under the Mirasvit_Helpdesk header.

  4. Press the Load template button.

  5. Enter the new Template name (e.g., Email notification for customer).

  6. Change the Template subject and Template content as needed, then save the template.

  7. Go to Sales -> Helpdesk -> Settings -> Email notification settings. Select your new template from the dropdown list of necessary notifications.

  8. Save the configuration.

Note

In email templates, you can use the following variables:

  • {{var customer.name}} - customer name
  • {{var customer.email}} - customer email
  • {{var ticket.code}} - ticket code
  • {{var ticket.name}} - ticket subject
  • {{var ticket.department}} - ticket department name
  • {{var ticket.status}} - ticket status name
  • {{var ticket.priority}} - ticket priority name
  • {{var ticket.getCreatedAtFormated($format)}} - date the ticket was created
  • {{var ticket.getUpdatedAtFormated($format)}} - date the ticket was updated
  • {{var ticket.getLastMessageHtmlText()}} - current ticket message (in HTML format)
  • {{block class='Mirasvit\\Helpdesk\\Block\\Email\\History' area='frontend' template='Mirasvit_Helpdesk::email/history.phtml' ticket=$ticket}} - block with ticket history
  • {{var ticket.getExternalUrl() }} - external ticket URL
  • {{var store.getFrontendName()}} - your store name
  • {{var user.firstname}} - ticket owner's first name
  • {{var user.lastname}} - ticket owner's last name
  • {{var user.email}} - ticket owner's email
  • {{var department.name}} - ticket department name

$format can only be one of the following types: none, full, long, medium, short, traditional, gregorian. For more information, please check PHP documentation.

Custom fields can also be used as variables through their codes, prefixed with f_. For example, if you have a custom field with the code test_field, the proper email variable should be {{var ticket.f_test_field}}. For custom fields of type Drop-down list, the variable {{var ticket.f_test_field_label}} displays the label for the selected value.