Skip to content
Snippets Groups Projects
Commit e8141623 authored by Peter Rotich's avatar Peter Rotich
Browse files

Stop internal note alerts from being sent to the staff posting the note/activity.

parent f4c39bd6
No related branches found
No related tags found
No related merge requests found
......@@ -1549,8 +1549,11 @@ class Ticket {
$attachments = $note->getAttachments();
$sentlist=array();
foreach( $recipients as $k=>$staff) {
if(!$staff || !is_object($staff) || !$staff->getEmail() || !$staff->isAvailable()) continue;
if(in_array($staff->getEmail(), $sentlist) || ($staffId && $staffId==$staff->getId())) continue;
if(!is_object($staff)
|| !$staff->isAvailable() //Don't bother vacationing staff.
|| in_array($staff->getEmail(), $sentlist) //No duplicates.
|| $note->getStaffId() == $staff->getId()) //No need to alert the poster!
continue;
$alert = str_replace('%{recipient}', $staff->getFirstName(), $msg['body']);
$email->sendAlert($staff->getEmail(), $msg['subj'], $alert, $attachments);
$sentlist[] = $staff->getEmail();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment