Skip to main content

How to customize the email template

To change the email template of the Helpdesk, you need to do the following steps:

  1. Go to the Marketing -> Email templates.

  2. Press the button Add new template.

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

  4. Press the button Load template.

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

  6. Change Template subject and Template content as you need, and save the template.

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

  8. Save 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}} - name of ticket department
  • {{var ticket.status}} - name of ticket status
  • {{var ticket.priority}} - name of ticket priority
  • {{var ticket.getCreatedAtFormated($format)}}- date ticket was created
  • {{var ticket.getUpdatedAtFormated($format)}}- date ticket was updated
  • {{var ticket.getLastMessageHtmlText()}} - current ticket's 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's URL
  • {{var store.getFrontendName()}} - name of your store
  • {{var user.firstname}} - first name of ticket owner
  • {{var user.lastname}} - last name of ticket owner
  • {{var user.email}} - email of ticket owner
  • {{var department.name}} - name of ticket's department

$format can only be of one of these types: none, full, long, medium, short, traditional, gregorian. For more information, please check https://www.php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants

Custom fields can also be used as variables through their codes, which are prefixed with f_ prefix. 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 a label for the selected value.