diff --git a/include/class.ticket.php b/include/class.ticket.php index d6a4fd32951b6917b2b1f918f49a4281aa65cb82..c1e4cdf23803dd48065dadef0da032130b1283dd 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1415,16 +1415,17 @@ class Ticket{ $this->onResponse(); //do house cleaning.. $this->reload(); - $dept = $this->getDept(); /* email the user?? - if disabled - the bail out */ if(!$alert) return $respId; + $dept = $this->getDept(); + if(!($tpl = $dept->getTemplate())) $tpl= $cfg->getDefaultTemplate(); - if(!($email=$cfg->getAlertEmail())) - $email =$cfg->getDefaultEmail(); + if(!$dept || !($email=$dept->getEmail())) + $email = $cfg->getDefaultEmail(); if($tpl && ($msg=$tpl->getReplyMsgTemplate()) && $email) { $body=$this->replaceTemplateVars($msg['body']);