/** * Send a notification of this action to the actionPerson * * Does not send if the enteredByPerson and actionPerson are the same person * @param Ticket $ticket */ public function sendNotification(Ticket $ticket = null) { $enteredByPerson = $this->getEnteredByPerson(); $actionPerson = $this->getActionPerson(); $url = $ticket ? $ticket->getURL() : ''; if ($actionPerson && (!$enteredByPerson || $enteredByPerson->getId() != $actionPerson->getId())) { $actionPerson->sendNotification("{$url}\n\n{$this->getDescription()}\n\n{$this->getNotes()}", APPLICATION_NAME . ' ' . $this->getAction(), $ticket->getCategory()->getNotificationReplyEmail()); } }