/** * create Send a email to all subscriber * @param IncidentEvent $event * @return */ public function create(IncidentEvent $event) { $subscriberRepository = $this->em->getRepository('AppBundle:Core\\Subscriber'); $subscribers = $subscriberRepository->findAllSubscribers()->getQuery()->getResult(); $incident = $event->getIncident(); if (count($subscribers) > 0) { foreach ($subscribers as $subscriber) { $this->mailer->sendIncidentMailToSubscriber($incident, $subscriber); } } }
/** * create Send a notification to all notifier available * @param IncidentEvent $event * @return */ public function create(IncidentEvent $event) { $incident = $event->getIncident(); $this->notification->sendIncidentNotification($incident); }
/** * @param \Swift_Mailer $mailer * @param RouterInterface $router * @param EngineInterface $templating * @param TranslatorInterface $translator */ public function __construct(\Swift_Mailer $mailer, RouterInterface $router, EngineInterface $templating, TranslatorInterface $translator) { $this->translator = $translator; parent::__construct($mailer, $router, $templating); }