summaryrefslogtreecommitdiff
path: root/app/Model/Notification.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/Notification.php')
-rw-r--r--app/Model/Notification.php7
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());
}
}