From 7ecafff694772d7dbfb036e658d8730d7cc957fa Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Sun, 7 Jun 2015 20:10:17 +0000 Subject: [PATCH] oops: Use department's email when available The bug was partly due to switch to ORM. --- include/class.dept.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/class.dept.php b/include/class.dept.php index 90cbe3a4b..f7b39c6e4 100644 --- a/include/class.dept.php +++ b/include/class.dept.php @@ -55,7 +55,6 @@ implements TemplateVariable { var $config; var $template; - var $email; var $autorespEmail; const ALERTS_DISABLED = 2; @@ -128,13 +127,10 @@ implements TemplateVariable { function getAlertEmail() { global $cfg; - if (!$this->email && ($id = $this->getEmailId())) { - $this->email = Email::lookup($id); - } - if (!$this->email && $cfg) { - $this->email = $cfg->getAlertEmail(); - } - return $this->email; + if ($this->email) + return $this->email; + + return $cfg ? $cfg->getDefaultEmail() : null; } function getEmail() { -- GitLab