Following my PR POC earlier this month (inspired by this post), I wanted to gather any thoughts on how we should implement custom email wording/content for ticket-related emails.
From a backed point of view we could have a table called custom_email_wording. With some columns like
- email_wording_ticket_create_subject
- email_wording_ticket_create_body
- email_wording_ticket_update_subject
- email_wording_ticket_update_body
- email_wording_ticket_autoclose_subject
- email_wording_ticket_autoclose_body
- email_wording_ticket_closed_subject
- email_wording_ticket_closed_body
- And then maybe in the future - email_wording_quote_body
These values would be set by default during install/upgrade, but then editable in the Admin Settings. You'd be able to use variables like #TICKET_CONTACT_NAME#
and #TICKET_AGENT#
to customise the email templates sent out during the ticket lifecycle.
For instance ticket_create_subject
is set to Ticket created - [#TICKET_PREFIX##TICKET_NUMBER#] - #TICKET_SUBJECT#
but you could change this to anything you wanted from the below list:
"#TICKET_CONTACT_NAME#" => $contact_name,
"#TICKET_PREFIX#" => $ticket_prefix,
"#TICKET_NUMBER#" => $ticket_number,
"#TICKET_URL#" => "https://$config_base_url/portal/ticket.php?id=$ticket_id",
"#TICKET_SUBJECT#" => $ticket_subject,
"#TICKET_PRIORITY#" => $ticket_priority,
"#TICKET_STATUS#" => $ticket_status,
"#TICKET_CATEGORY#" => $ticket_category,
"#TICKET_AGENT#", // todo
"#TICKET_COMPANY_NAME#" => $session_company_name,
"#TICKET_COMPANY_EMAIL" => $config_ticket_from_email,
--
Not too sure about the table / column names specifically, but I think the general idea is there.
Thoughts?
itflow-org/itflow719