diff --git a/include/class.config.php b/include/class.config.php index 7c2995a8d8fb1856978388bcdbccba1b52b8003c..a85fc696263e4316da1f0181e6ccf6a4ea6921ce 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -847,6 +847,88 @@ class OsticketConfig extends Config { return ($this->get('overlimit_notice_active')); } + /* Tasks */ + + function alertONNewTask() { + return ($this->get('task_alert_active')); + } + + function alertAdminONNewTask() { + return ($this->get('task_alert_admin')); + } + + function alertDeptManagerONNewTask() { + return ($this->get('task_alert_dept_manager')); + } + + function alertDeptMembersONNewTask() { + return ($this->get('task_alert_dept_members')); + } + + function alertONTaskActivity() { + return ($this->get('task_activity_alert_active')); + } + + function alertLastRespondentONTaskActivity() { + return ($this->get('task_activity_alert_laststaff')); + } + + function alertAssignedONTaskActivity() { + return ($this->get('task_activity_alert_assigned')); + } + + function alertDeptManagerONTaskActivity() { + return ($this->get('task_activity_alert_dept_manager')); + } + + function alertONTaskTransfer() { + return ($this->get('task_transfer_alert_active')); + } + + function alertAssignedONTaskTransfer() { + return ($this->get('task_transfer_alert_assigned')); + } + + function alertDeptManagerONTaskTransfer() { + return ($this->get('task_transfer_alert_dept_manager')); + } + + function alertDeptMembersONTaskTransfer() { + return ($this->get('task_transfer_alert_dept_members')); + } + + function alertONTaskAssignment() { + return ($this->get('task_assignment_alert_active')); + } + + function alertStaffONTaskAssignment() { + return ($this->get('task_assignment_alert_staff')); + } + + function alertTeamLeadONTaskAssignment() { + return ($this->get('task_assignment_alert_team_lead')); + } + + function alertTeamMembersONTaskAssignment() { + return ($this->get('task_assignment_alert_team_members')); + } + + function alertONOverdueTask() { + return ($this->get('task_overdue_alert_active')); + } + + function alertAssignedONOverdueTask() { + return ($this->get('task_overdue_alert_assigned')); + } + + function alertDeptManagerONOverdueTask() { + return ($this->get('task_overdue_alert_dept_manager')); + } + + function alertDeptMembersONOverdueTask() { + return ($this->get('task_overdue_alert_dept_members')); + } + /* Error alerts sent to admin email when enabled */ function alertONSQLError() { return ($this->get('send_sql_errors')); diff --git a/include/class.template.php b/include/class.template.php index a48e5255d47dac70bea9234388b6ef81f35b6bf3..c1bdb80df2135a6b81c09a33c6d7973dbd03c5a4 100644 --- a/include/class.template.php +++ b/include/class.template.php @@ -23,12 +23,13 @@ class EmailTemplateGroup { var $_templates; static $all_groups = array( 'sys' => /* @trans */ 'System Management Templates', - 'ticket.user' => /* @trans */ 'End-User Email Templates', - 'ticket.staff' => /* @trans */ 'Agent Email Templates', + 'a.ticket.user' => /* @trans */ 'Ticket End-User Email Templates', + 'b.ticket.staff' => /* @trans */ 'Ticket Agent Email Templates', + 'c.task' => /* @trans */ 'Task Email Templates', ); static $all_names=array( 'ticket.autoresp'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'New Ticket Auto-response', 'desc'=>/* @trans */ 'Autoresponse sent to user, if enabled, on new ticket.', 'context' => array( @@ -36,7 +37,7 @@ class EmailTemplateGroup { ), ), 'ticket.autoreply'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'New Ticket Auto-reply', 'desc'=>/* @trans */ 'Canned Auto-reply sent to user on new ticket, based on filter matches. Overwrites "normal" auto-response.', 'context' => array( @@ -44,7 +45,7 @@ class EmailTemplateGroup { ), ), 'message.autoresp'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'New Message Auto-response', 'desc'=>/* @trans */ 'Confirmation sent to user when a new message is appended to an existing ticket.', 'context' => array( @@ -52,7 +53,7 @@ class EmailTemplateGroup { ), ), 'ticket.notice'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'New Ticket Notice', 'desc'=>/* @trans */ 'Notice sent to user, if enabled, on new ticket created by an agent on their behalf (e.g phone calls).', 'context' => array( @@ -60,7 +61,7 @@ class EmailTemplateGroup { ), ), 'ticket.overlimit'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'Over Limit Notice', 'desc'=>/* @trans */ 'A one-time notice sent, if enabled, when user has reached the maximum allowed open tickets.', 'context' => array( @@ -68,7 +69,7 @@ class EmailTemplateGroup { ), ), 'ticket.reply'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'Response/Reply Template', 'desc'=>/* @trans */ 'Template used on ticket response/reply', 'context' => array( @@ -76,7 +77,7 @@ class EmailTemplateGroup { ), ), 'ticket.activity.notice'=>array( - 'group'=>'ticket.user', + 'group'=>'a.ticket.user', 'name'=>/* @trans */ 'New Activity Notice', 'desc'=>/* @trans */ 'Template used to notify collaborators on ticket activity (e.g CC on reply)', 'context' => array( @@ -84,7 +85,7 @@ class EmailTemplateGroup { ), ), 'ticket.alert'=>array( - 'group'=>'ticket.staff', + 'group'=>'b.ticket.staff', 'name'=>/* @trans */ 'New Ticket Alert', 'desc'=>/* @trans */ 'Alert sent to agents, if enabled, on new ticket.', 'context' => array( @@ -92,7 +93,7 @@ class EmailTemplateGroup { ), ), 'message.alert'=>array( - 'group'=>'ticket.staff', + 'group'=>'b.ticket.staff', 'name'=>/* @trans */ 'New Message Alert', 'desc'=>/* @trans */ 'Alert sent to agents, if enabled, when user replies to an existing ticket.', 'context' => array( @@ -100,7 +101,7 @@ class EmailTemplateGroup { ), ), 'note.alert'=>array( - 'group'=>'ticket.staff', + 'group'=>'b.ticket.staff', 'name'=>/* @trans */ 'Internal Activity Alert', 'desc'=>/* @trans */ 'Alert sent out to Agents when internal activity such as an internal note or an agent reply is appended to a ticket.', 'context' => array( @@ -108,7 +109,7 @@ class EmailTemplateGroup { ), ), 'assigned.alert'=>array( - 'group'=>'ticket.staff', + 'group'=>'b.ticket.staff', 'name'=>/* @trans */ 'Ticket Assignment Alert', 'desc'=>/* @trans */ 'Alert sent to agents on ticket assignment.', 'context' => array( @@ -116,7 +117,7 @@ class EmailTemplateGroup { ), ), 'transfer.alert'=>array( - 'group'=>'ticket.staff', + 'group'=>'b.ticket.staff', 'name'=>/* @trans */ 'Ticket Transfer Alert', 'desc'=>/* @trans */ 'Alert sent to agents on ticket transfer.', 'context' => array( @@ -124,13 +125,45 @@ class EmailTemplateGroup { ), ), 'ticket.overdue'=>array( - 'group'=>'ticket.staff', + 'group'=>'b.ticket.staff', 'name'=>/* @trans */ 'Overdue Ticket Alert', 'desc'=>/* @trans */ 'Alert sent to agents on stale or overdue tickets.', 'context' => array( 'ticket', 'recipient', 'comments', ), ), + 'task.alert' => array( + 'group'=>'c.task', + 'name'=>/* @trans */ 'New Task Alert', + 'desc'=>/* @trans */ 'Alert sent to agents, if enabled, on new task.', + ), + 'task.activity.notice' => array( + 'group'=>'c.task', + 'name'=>/* @trans */ 'New Activity Notice', + 'desc'=>/* @trans */ 'Template used to notify collaborators on task activity.' + ), + 'task.activity.alert'=>array( + 'group'=>'c.task', + 'name'=>/* @trans */ 'New Activity Alert', + 'desc'=>/* @trans */ 'Alert sent to selected agents, if enabled, on new activity.', + + ), + 'task.assignment.alert' => array( + 'group'=>'c.task', + 'name'=>/* @trans */ 'Task Assignment Alert', + 'desc'=>/* @trans */ 'Alert sent to agents on task assignment.', + ), + 'task.transfer.alert'=>array( + 'group'=>'c.task', + 'name'=>/* @trans */ 'Task Transfer Alert', + 'desc'=>/* @trans */ 'Alert sent to agents on task transfer.', + ), + 'task.overdue.alert'=>array( + 'group'=>'c.task', + 'name'=>/* @trans */ 'Overdue Task Alert', + 'desc'=>/* @trans */ 'Alert sent to agents on stale or overdue + task.', + ), ); function EmailTemplateGroup($id){ @@ -300,6 +333,27 @@ class EmailTemplateGroup { return $this->getMsgTemplate('ticket.overdue'); } + /* Tasks templates */ + function getNewTaskAlertMsgTemplate() { + return $this->getMsgTemplate('task.alert'); + } + + function getTaskActivityNoticeMsgTemplate() { + return $this->getMsgTemplate('task.activity.notice'); + } + + function getTaskTransferAlertMsgTemplate() { + return $this->getMsgTemplate('task.transfer.alert'); + } + + function getTaskAssignmentAlertMsgTemplate() { + return $this->getMsgTemplate('task.assignment.alert'); + } + + function getTaskOverdueAlertMsgTemplate() { + return $this->getMsgTemplate('task.overdue.alert'); + } + function update($vars,&$errors) { if(!$vars['isactive'] && $this->isInUse()) $errors['isactive']=__('In-use template set cannot be disabled!'); diff --git a/include/i18n/en_US/templates/email/task.activity.alert.yaml b/include/i18n/en_US/templates/email/task.activity.alert.yaml new file mode 100644 index 0000000000000000000000000000000000000000..82e7c4ce04474cf4214844d8492560074451dc1d --- /dev/null +++ b/include/i18n/en_US/templates/email/task.activity.alert.yaml @@ -0,0 +1,54 @@ +# +# Email template: task.activity.alert.yaml +# +# Sent to agents when a new note/message is posted to a task. +# This can occur if a collaborator or an agent responds to an email from the +# system or visits the web portal and posts a new message there. +# +# +--- +notes: | + Sent to agents when a new message/note is posted to a task. This can + occur if a collaborator or an agent responds to an email from the system + or visits the web portal and posts a new message there. + +subject: | + New Activity Alert +body: | + <h3><strong>Hi %{recipient.name},</strong></h3> + New message appended to task <a + href="%{ticket.staff_link}">#%{task.number}</a> + <br> + <br> + <table> + <tbody> + <tr> + <td> + <strong>Title</strong>: + </td> + <td> + %{task.title} + </td> + </tr> + <tr> + <td> + <strong>Department</strong>: + </td> + <td> + %{task.dept.name} + </td> + </tr> + </tbody> + </table> + <br> + %{message} + <br> + <br> + <hr> + <div>To view or respond to the task, please <a + href="%{task.staff_link}"><span style="color: rgb(84, 141, 212);" + >login</span></a> to the support system</div> + <em style="color: rgb(127,127,127); font-size: small; ">Your friendly + Customer Support System</em><br> + <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" + alt="Powered by osTicket" width="126" height="19" style="width: 126px;"> diff --git a/include/i18n/en_US/templates/email/task.activity.notice.yaml b/include/i18n/en_US/templates/email/task.activity.notice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..45d1e3e51aecdf64851b0f54fc230f71824be969 --- /dev/null +++ b/include/i18n/en_US/templates/email/task.activity.notice.yaml @@ -0,0 +1,28 @@ +# +# Email template: task.activity.notice.yaml +# +# Notice sent to collaborators on task activity e.g reply or message +# +--- +notes: | + Notice sent to collaborators on task activity e.g note or message. + +subject: | + Re: %{task.title} [#%{task.number}] +body: | + <h3><strong>Dear %{recipient.name.first},</strong></h3> + <div> + <em>%{poster.name}</em> just logged a message to a task in which you participate. + </div> + <br> + %{message} + <br> + <br> + <hr> + <div style="color: rgb(127, 127, 127); font-size: small; text-align: center;"> + <em>You're getting this email because you are a collaborator + on task <a href="%{recipient.task_link}" style="color: rgb(84, 141, 212);" + >#%{task.number}</a>. To participate, simply reply to this email + or <a href="%{recipient.task_link}" style="color: rgb(84, 141, 212);" + >click here</a> for a complete archive of the task thread.</em> + </div> diff --git a/include/i18n/en_US/templates/email/task.alert.yaml b/include/i18n/en_US/templates/email/task.alert.yaml new file mode 100644 index 0000000000000000000000000000000000000000..08e311fe09f322b8c5606fb1d4e28d8d614aa678 --- /dev/null +++ b/include/i18n/en_US/templates/email/task.alert.yaml @@ -0,0 +1,41 @@ +# +# Email template: task.alert.yaml +# +# Sent to an agent when a new task is created in the system. +# +# +--- +notes: | + Sent to an agent when a new task is created in the system. + +subject: | + New Task Alert +body: | + <h2>Hi %{recipient.name},</h2> + New task #%{task.number} created + <br> + <br> + <table> + <tbody> + <tr> + <td> + <strong>Department</strong>: + </td> + <td> + %{task.dept.name} + </td> + </tr> + </tbody> + </table> + <br> + %{task.description} + <br> + <br> + <hr> + <div>To view or respond to the ticket, please <a + href="%{task.staff_link}">login</a> to the support system</div> + <em style="font-size: small">Your friendly Customer Support System</em> + <br> + <a href="http://osticket.com/"><img width="126" height="19" + style="width: 126px; " alt="Powered By osTicket" + src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"/></a> diff --git a/include/i18n/en_US/templates/email/task.assignment.alert.yaml b/include/i18n/en_US/templates/email/task.assignment.alert.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4c509b08bb812f629966688d727e09a494256ac9 --- /dev/null +++ b/include/i18n/en_US/templates/email/task.assignment.alert.yaml @@ -0,0 +1,45 @@ +# +# Email template: task.assignment.alert.yaml +# +# Sent to agents when a ticket is assigned to them or the team to which +# they belong. +# Use %{assigner} to distinguish who made the assignment. +# +--- +notes: | + Sent to agents when a ticket is assigned to them or the team to which + they belong. Use %{assigner} to distinguish who made the assignment. + +subject: | + Task Assigned to you +body: | + <h3><strong>Hi %{assignee.name.first},</strong></h3> + Task <a href="%{task.staff_link}">#%{task.number}</a> has been + assigned to you by %{assigner.name.short} + <br> + <br> + <table> + <tbody> + <tr> + <td> + <strong>Title</strong>: + </td> + <td> + %{task.title} + </td> + </tr> + </tbody> + </table> + <br> + %{comments} + <br> + <br> + <hr> + <div>To view/respond to the task, please <a + href="%{task.staff_link}"><span style="color: rgb(84, 141, 212);" + >login</span></a> to the support system</div> + <em style="font-size: small; ">Your friendly Customer Support + System</em> + <br> + <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" + alt="Powered by osTicket" width="126" height="19" style="width: 126px;"> diff --git a/include/i18n/en_US/templates/email/task.overdue.alert.yaml b/include/i18n/en_US/templates/email/task.overdue.alert.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0b48a7337e04efd6dbdf6c0f8c7cfeb15d7b463f --- /dev/null +++ b/include/i18n/en_US/templates/email/task.overdue.alert.yaml @@ -0,0 +1,38 @@ +# +# Email template: task.overdue.alert.yaml +# +# Sent to agents when a tasks transitions to overdue in the system. +# Overdue tasks occur based on set due-date as well as the SLA +# defined for the task. +# +--- +notes: | + Sent to agents when a task transitions to overdue in the system. + Overdue tasks occur based on the set due-date as well as the SLA + defined for the task. + +subject: | + Stale Task Alert +body: | + <h3><strong>Hi %{recipient.name}</strong>,</h3> + A task, <a href="%{task.staff_link}">#%{task.number}</a> is + seriously overdue. + <br> + <br> + We should all work hard to guarantee that all tasks are being + addressed in a timely manner. + <br> + <br> + Signed,<br> + %{task.dept.manager.name} + <hr> + <div>To view or respond to the task, please <a + href="%{task.staff_link}"><span style="color: rgb(84, 141, 212);" + >login</span></a> to the support system. You're receiving this + notice because the task is assigned directly to you or to a team or + department of which you're a member.</div> + <em style="font-size: small">Your friendly <span style="font-size: smaller" + >(although with limited patience)</span> Customer Support + System</em><br> + <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" height="19" + alt="Powered by osTicket" width="126" style="width: 126px;"> diff --git a/include/i18n/en_US/templates/email/task.transfer.alert.yaml b/include/i18n/en_US/templates/email/task.transfer.alert.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6e2d26a26865a03c58495045965d87d24e215137 --- /dev/null +++ b/include/i18n/en_US/templates/email/task.transfer.alert.yaml @@ -0,0 +1,31 @@ +# +# Email template: task.transfer.alert.yaml +# +# Sent to agents when a task is transfered to their department. +# +--- +notes: | + Sent to agents when a task is transfered to a department to which + they are a member. +subject: | + Task #%{task.number} transfer - %{task.dept.name} +body: | + <h3>Hi %{recipient.name},</h3> + Task <a href="%{task.staff_link}">#%{task.number}</a> has been + transferred to the %{task.dept.name} department by + <strong>%{staff.name.short}</strong> + <br> + <br> + <blockquote> + %{comments} + </blockquote> + <hr> + <div>To view or respond to the task, please <a + href="%{task.staff_link}">login</a> to the support system. + </div> + <em style="font-size: small; ">Your friendly Customer Support + System</em> + <br> + <a href="http://osticket.com/"><img width="126" height="19" + alt="Powered By osTicket" style="width: 126px;" + src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"/></a>