This following modification is being intended to answer the question about the similar modification that asking about the title of this article. You may enable or disable this feature from admin panel. If you want your osTicket also send an alert to all department members when new response that being sent by staff comes to the system, then this following modification is for you!
-
First of all, you have to alter the ost_config table by adding a new field named note_alert_dept_members. You may use this SQL script from phpMyAdmin or your another MySQL tool. Please note that ost_ is the table name prefix. Adjust it by yourself in case it differs with yours:
ALTER TABLE ost_config ADD COLUMN `note_alert_dept_members` tinyint(1) default 0 NOT NULL;
-
Open your \include\staff\preference.inc.php file, and find this code:
435
<input type="checkbox" name="note_alert_dept_manager" <?=$config['note_alert_dept_manager']?'checked':''?>> Department Manager (spammy)
then after the last line of that code, please insert this following code:
436
<input type="checkbox" name="note_alert_dept_members" <?=$config['note_alert_dept_members']?'checked':''?>> Department Members (spammy)
-
Open your \include\class.config.php file, and find this code:
322 323 324
function alertDeptManagerONNewNote() { return $this->config['note_alert_dept_manager']?true:false; }
then after the last line of that code, please insert this following code:
326 327 328 329
// MOD Alert Dept Members on New Note, added by Masino Sinaga, November 14, 2009 function alertDeptMembersONNewNote() { return $this->config['note_alert_dept_members']?true:false; }
Find again this code:
476 477 478 479
if($var['note_alert_active'] && (!isset($var['note_alert_laststaff']) && !isset($var['note_alert_assigned']) && !isset($var['note_alert_dept_manager']))){
then replace with this following code:
476 477 478 479 480
if($var['note_alert_active'] && (!isset($var['note_alert_laststaff']) && !isset($var['note_alert_assigned']) && !isset($var['note_alert_dept_manager']) && !isset($var['note_alert_dept_members']))){ // added by Masino Sinaga, Nov 14, 2009
Find again this code:
536
',note_alert_dept_manager='.db_input(isset($var['note_alert_dept_manager'])?1:0).
then replace with this following code:
536 537
',note_alert_dept_manager='.db_input(isset($var['note_alert_dept_manager'])?1:0). ',note_alert_dept_members='.db_input(isset($var['note_alert_dept_members'])?1:0). // added by Masino Sinaga, Nov 14, 2009
-
Open your \include\class.ticket.php file, and find this code:
827 828 829
//Dept manager if($cfg->alertDeptManagerONNewNote() && $dept) $recipients[]=$dept->getManager();
then after the last line of that code, please insert this following code:
831 832 833 834 835 836 837 838
//Dept members, added by Masino Sinaga, Nov 14, 2009 if($cfg->alertDeptMembersONNewNote() && $dept) { $sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvacation=0 AND dept_id='.db_input($dept->getId()); if(($users=db_query($sql)) && db_num_rows($users)) { while(list($id)=db_fetch_row($users)) $recipients[]= new Staff($id); } }
That’s all. Hope it helps you.

Hi Masino,
Is it possible to modify this to alert when different department members replies to the ticket ?, I’ve noticed that when two departments are involved in one ticket , for example if department A and B are involved in a ticket, if member from department A reply to the ticket only members from the department A get the alert, can it be modified so that members from department B also get the alert ?.
Kind Regards,
Dileepa.
Hi Dileepa,
Thanks for your feedback. I will try to implement it. Stay tuned.
Hi Masino,
Any updates on my request.
Kind Regards,
Dileepa.
Hi Dleepa,
I am so sorry, I still have not had time to update the modification above.
Thanks for the code. It works well, but one thing:
When posting an internal note I was getting an error message: “Error(s) occured. Unable to post the note.” But the note was actually posting just fine. The problem was that the variable $id in the postNote function in class.ticket.php (modified in the last code snippet of your post) was getting overwritten by your new code. I replaced $id with another variable name and it seems to be working fine now.
Hi,
Can you please explain to me, what you did to make this work ?? I can’t find out
Hi Guys,
I am just new to OSTicket and I have implemented the change above.
However, it is not working.
I think it may be that I cannot find where to enable this in admin panel.
can someone tell me where this is?
Thanks
Guys,
As far as I can see this only adds funtionality to the ‘New Internal Note Alert’ function.
What I am looking for is functionality where is any staff member or the customer adds data in the form of ‘New Message Alert’ then an email is sent to all staff, even staff memebers that are not assigned to the cases as well as the customer.
Any ideas?
Thanks
Gareth