diff --git a/EventListener/EmailSenderListener.php b/EventListener/EmailSenderListener.php index 8e4ef7e5..1cbb873d 100644 --- a/EventListener/EmailSenderListener.php +++ b/EventListener/EmailSenderListener.php @@ -13,8 +13,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\IntrospectableContainerInterface; -use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\Console\ConsoleEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -33,7 +33,7 @@ public function __construct(ContainerInterface $container) $this->container = $container; } - public function onKernelTerminate(PostResponseEvent $event) + public function onTerminate() { if (!$this->container->has('mailer')) { return; @@ -57,6 +57,9 @@ public function onKernelTerminate(PostResponseEvent $event) static public function getSubscribedEvents() { - return array(KernelEvents::TERMINATE => 'onKernelTerminate'); + return array( + KernelEvents::TERMINATE => 'onTerminate', + ConsoleEvents::TERMINATE => 'onTerminate' + ); } }