From b081288188bb1744c9d7bd075aa5936e0ccbb9c4 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 14 Nov 2014 22:44:25 -0500 Subject: Use Pimple instead of Core\Registry and add Monolog for logging --- app/Model/Notification.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/Model/Notification.php') 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()); } } -- cgit v1.2.3