diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-14 22:44:25 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-14 22:44:25 -0500 |
commit | b081288188bb1744c9d7bd075aa5936e0ccbb9c4 (patch) | |
tree | 68008e35eb129f74b9b2a49f6f6076ed02b601c6 /app/Model/Notification.php | |
parent | 1487cb27634161ef558c367150213bc7077e4198 (diff) |
Use Pimple instead of Core\Registry and add Monolog for logging
Diffstat (limited to 'app/Model/Notification.php')
-rw-r--r-- | app/Model/Notification.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/Model/Notification.php b/app/Model/Notification.php index d2fcf525..32765041 100644 --- a/app/Model/Notification.php +++ b/app/Model/Notification.php @@ -117,7 +117,7 @@ class Notification extends Base foreach ($events as $event_name => $template_name) { - $listener = new NotificationListener($this->registry); + $listener = new NotificationListener($this->container); $listener->setTemplate($template_name); $this->event->attach($event_name, $listener); @@ -135,8 +135,7 @@ class Notification extends Base public function sendEmails($template, array $users, array $data) { try { - $transport = $this->registry->shared('mailer'); - $mailer = Swift_Mailer::newInstance($transport); + $mailer = Swift_Mailer::newInstance($this->container['mailer']); $message = Swift_Message::newInstance() ->setSubject($this->getMailSubject($template, $data)) @@ -149,7 +148,7 @@ class Notification extends Base } } catch (Swift_TransportException $e) { - debug($e->getMessage()); + $this->container['logger']->addError($e->getMessage()); } } |