Undoing osTicket’s staff alert email change in 1.9.5

Undoing osTicket’s staff alert email change in 1.9.5

I’ve unpleasantly noticed that osTicket 1.9.5(.1) changed functionality and is now sending staff alert emails from the department email (if one is set). Old behaviour was to sent these alerts from the (configured) alerts email address.

Some may prefer the new way better (this is most likely why it got implemented), but I very much liked the old way of getting all alerts from one unified source (I already have filters set up for it and I can also set a particular name so it stands out in the waves of emails I get daily).

Fortunately, the revert procedure is rather simple, requiring a single line of code change. Start by opening up osticket/include/class.dept.php in your favorite editor and change the getAlertEmail() function to match the code below:

function getAlertEmail() {
global $cfg;

    if (!$this->email && ($id = $this->getEmailId())) {
        $this->email = Email::lookup($id);
    }
    if (!$this->email && $cfg) {
        $this->email = $this->getEmail();
    }
    // return $this->email;       // used to return department email (fetched above) if it existed - commented out
    return $cfg->getAlertEmail(); // now returns the configured alerts email, no matter what
}

Leave a Reply