From 68bb27ffccba3df834208e566f6b0954916a2238 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Sun, 26 Jan 2014 21:25:41 +0000
Subject: [PATCH] Disable alerts to staff on auto-reply

The concern here is possible loop when an alert to staff bounces back to the
system.
---
 include/class.ticket.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index 08e2e29d0..673ddf309 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -2166,6 +2166,11 @@ class Ticket {
         if($autorespond && $dept && !$dept->autoRespONNewTicket())
             $autorespond=false;
 
+        //Don't send alerts to staff when the message is an auto reply
+        //  this is necessary to avoid possible loop (especially on new ticket)
+        if ($alertstaff && $message->isAutoReply())
+            $alertstaff = false;
+
         /***** See if we need to send some alerts ****/
         $ticket->onNewTicket($message, $autorespond, $alertstaff);
 
-- 
GitLab