Use Pimple instead of Core\Registry and add Monolog for logging
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user