/** * After Update method * * Triggers mail sender on update. */ public function afterUpdate() { $mailer = new SupportMailer(); $email = $this->creator->email; $address = Settings::get('address'); $vars = ['ticket_number' => $this->hash_id, 'ticket_link' => $address . '/' . $this->hash_id, 'ticket_status' => $this->status->name]; if ($this->status == 'Closed' || $this->status == 'Resolved') { $mailer->sendAfterTicketClosed($email, $vars); } else { if ($this->is_support == 1) { $mailer->sendAfterTicketUpdated($email, $vars); } } }