Ticket
The following hooks are provided for Ticket related events.
AdminAreaViewTicketPage
Executes when an admin views a support ticket within the admin area.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID which is being viewed |
Response
Returned HTML will be output to the page.
Example Code
<?php
add_hook('AdminAreaViewTicketPage', 1, function($vars)
{
$html = '<div class="alert alert-info" role="alert">You are watching this ticket</div>';
return $html;
});
AdminSupportTicketPagePreTickets
Executes prior to aggregation and output of the support tickets listing page within the admin area.
Parameters
| Variable | Type | Notes |
|---|---|---|
| No input parameters for this hook point. | ||
Response
Returned HTML will be output to the page.
Example Code
<?php
add_hook('AdminSupportTicketPagePreTickets', 1, function($vars)
{
$html = 'Your Html text or Content here';
return $html;
});
ClientAreaPageSubmitTicket
Executes on the client area ticket submission page and accepts a return of key/value pairs to be made available as additional Smarty template parameters. Input parameters include all currently defined template variables. The following is a list of template variables common to all pages. Additional variables will vary depending upon the page being rendered.
Parameters
| Variable | Type | Notes |
|---|---|---|
| No parameters supported | ||
Response
A key/value pair array of additional template variables to define.
Example Code
<?php
add_hook('ClientAreaPageSubmitTicket', 1, function($vars)
{
return ["key"=>"values"];
});
ClientAreaPageSupportTickets
Executes on the client area support tickets overview page and accepts a return of key/value pairs to be made available as additional Smarty template parameters. Input parameters include all currently defined template variables. The following is a list of template variables common to all pages. Additional variables will vary depending upon the page being rendered.
Parameters
| Variable | Type | Notes |
|---|---|---|
| No parameters supported | ||
Response
A key/value pair array of additional template variables to define.
Example Code
<?php
add_hook('ClientAreaPageSupportTickets', 1, function($vars)
{
return ["key"=>"values"];
});
ClientAreaPageViewTicket
Executes on the client area view ticket page and accepts a return of key/value pairs to be made available as additional Smarty template parameters. Input parameters include all currently defined template variables. The following is a list of template variables common to all pages. Additional variables will vary depending upon the page being rendered.
Parameters
| Variable | Type | Notes |
|---|---|---|
| No parameters supported | ||
Response
A key/value pair array of additional template variables to define.
Example Code
<?php
add_hook('ClientAreaPageViewTicket', 1, function($vars)
{
return ["key"=>"values"];
});
TicketAddNote
Executes when a ticket note is added.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| message | string | Support Ticket Note Text |
| attachments | string | Note attachment files |
| admins | array | Admins List as Array |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketAddNote', 1, function($vars)
{
});
TicketAdminReply
Executes when a reply is added to a ticket by an admin user.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| reply_id | int | Reply Added ID |
| message | string | Support Ticket Note Text |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketAdminReply', 1, function($vars)
{
});
TicketClose
Executes when a ticket is closed.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketClose', 1, function($vars)
{
});
TicketDelete
Executes when a ticket is deleted..
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| admin_id | int | The admin ID who initiated the action |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketDelete', 1, function($vars)
{
});
TicketDeleteReply
Executes when a ticket reply is deleted.
Parameters
| Variable | Type | Notes |
|---|---|---|
| reply_id | int | Support Ticket Reply ID |
| admin_id | int | The admin ID who initiated the action |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketDeleteReply', 1, function($vars)
{
});
TicketDepartmentChange
Executes as a ticket department is changed.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| dept_id | int | Department ID |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketDepartmentChange', 1, function($vars)
{
});
TicketFlagged
Executes as a ticket is flagged.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| admin_id | int | Admin ID |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketFlagged', 1, function($vars)
{
});
TicketMerge
Executes when tickets are merged into each other.
Parameters
| Variable | Type | Notes |
|---|---|---|
| masterTicketId | int | Support Ticket ID |
| mergedTickets | int | Mergeable Tickets ID |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketMerge', 1, function($vars)
{
});
TicketOpen
Executes when a ticket is opened by an end user.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| ticket_no | string | Ticket Number |
| user_id | int | Client ID who is created ticket |
| name | string | Client Name |
| string | Client Email address | |
| entry_date | string | Ticket Creation date |
| autoclose_date | string | Ticket Auto Close Date |
| status | string | Ticket status |
| priority | string | Ticket Priority |
| department_id | int | Ticket Department ID |
| isAdmin | bool | If Ticket created by Admin then True else False |
| subject | string | Ticket Subject |
| message | string | Ticket Message |
| attachments | string | Ticket Attachments |
| cc_mails | string | Ticket CC Emails |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketOpen', 1, function($vars)
{
});
TicketOpenAdmin
Executes when a ticket is opened by an admin user.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | Support Ticket ID |
| ticket_no | string | Ticket Number |
| user_id | int | Client ID who is created ticket |
| name | string | Client Name |
| string | Client Email address | |
| entry_date | string | Ticket Creation date |
| autoclose_date | string | Ticket Auto Close Date |
| status | string | Ticket status |
| priority | string | Ticket Priority |
| department_id | int | Ticket Department ID |
| isAdmin | bool | If Ticket created by Admin then True else False |
| subject | string | Ticket Subject |
| message | string | Ticket Message |
| attachments | string | Ticket Attachments |
| cc_mails | string | Ticket CC Emails |
Response
No Response Supported.
Example Code
<?php
add_hook('TicketOpenAdmin', 1, function($vars)
{
});
TicketOpenValidation
Executes when an end user provides data for a new ticket submission.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_no | string | Ticket Number |
| user_id | int | Client ID who is created ticket |
| name | string | Client Name |
| string | Client Email address | |
| entry_date | string | Ticket Creation date |
| autoclose_date | string | Ticket Auto Close Date |
| status | string | Ticket status |
| priority | string | Ticket Priority |
| department_id | int | Ticket Department ID |
| isAdmin | bool | If Ticket created by Admin then True else False |
| subject | string | Ticket Subject |
| message | string | Ticket Message |
| attachments | string | Ticket Attachments |
| cc_mails | string | Ticket CC Emails |
Response
A key/value pair array to used as a singular Validation Error.
Example Code
<?php
add_hook('TicketOpenValidation', 1, function($vars)
{
return ["status"=>"error","message"=>"Your validation Error Text here"];
});
TicketPiping
Executes when a ticket is being imported via email.
Parameters
| Variable | Type | Notes |
|---|---|---|
| to | string | |
| cc | string | |
| name | string | |
| string | ||
| subject | string | |
| body | string | |
| attachments | string |
Response
Return $skipProcessing=true to abort importing of the given email.
Example Code
<?php
add_hook('TicketPiping', 1, function($vars)
{
return ["skipProcessing"=>true];
});
TicketPriorityChange
Executes when a ticket priority is changed
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | |
| priority | string |
Response
No response supported
Example Code
<?php
add_hook('TicketPriorityChange', 1, function($vars)
{
});
TicketStatusChange
Executes as a ticket status is changed manually by an admin.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | |
| admin_id | int | |
| status | string |
Response
No response supported
Example Code
<?php
add_hook('TicketStatusChange', 1, function($vars)
{
});
TicketSubjectChange
Executes when a ticket subject is changed. The ‘subject’ variable now contains the new subject.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | |
| subject | string |
Response
No response supported
Example Code
<?php
add_hook('TicketSubjectChange', 1, function($vars)
{
});
TicketUserReply
Executes when a reply is added to a ticket by an end user.
Parameters
| Variable | Type | Notes |
|---|---|---|
| ticket_id | int | |
| reply_id | int | |
| message | string |
Response
No response supported
Example Code
<?php
add_hook('TicketUserReply', 1, function($vars)
{
});
TransliterateTicketText
Invoked when a ticket is imported from email.
Parameters
| Variable | Type | Notes |
|---|---|---|
| subject | string | |
| message | string |
Response
Override the global variables $subject and $message to manipulate.
Example Code
<?php
add_hook('TransliterateTicketText', 1, function($vars)
{
return ['subject'=>'Override Subject here','message'=>'Override message here'];
});