Hi everybody,
today's Customer asked me to make osTicket send (almost) every alert to every staff member. They're using Blackberry phones: it makes sense for them to be alerted when a ticket is opened, but also when it gets assigned (so that they know that it is being worked on, without rushing to a web browser).
I've seen many threads dealing with the same scenario and wanted to share how I did:
First, I made it so that the Department Manager is a distribution list (grouping the guys who should receive the alerts). Of course, osTicket must be configured to send emails to the "fake" Department Manager (Staff Members should be left out, otherwise they will receive double-alerts). Then I applied this trivial patch to class.ticket.php:
556 $sql='SELECT assigned_alert_subj,assigned_alert_body FROM '.EMAIL_TEMPLATE_T
557 ' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($tplId);
558 if(($resp=db_query($sql)) && db_num_rows($resp) && list($subj,$body)=db_fetc
559
560 $body=$this->replaceTemplateVars($body);
561 $subj=$this->replaceTemplateVars($subj);
562 $body = str_replace('%note',$message,$body);
563 $body = str_replace("%message", $message,$body); //Previous versions use
564 $body = str_replace("%assignee", $staff->getName(),$body);
565 $body = str_replace("%assigner", ($thisuser)?$thisuser->getName():'Syste
566
567 if(!($email=$cfg->getAlertEmail()))
568 $email=$cfg->getDefaultEmail();
569
570 if($email) {
571 $email->send($staff->getEmail(),$subj,$body);
572 }
573 }else {
Replace line 571 with:
573 $email->send($dept->getManager()->getEmail(),$subj,$body);
It directs "Assigned" alerts to the Dept Manager rather than the Staff guy who, normally, would be the only recipient of the email.
I'm using osTicket 1.6.0 (the italian translation of it).
ciao,
--
Giuliano