/** * Notify a user of the end of the job * * @param JobExecutionEvent $event */ public function afterJobExecution(JobExecutionEvent $event) { $jobExecution = $event->getJobExecution(); $user = $jobExecution->getUser(); if (null === $user) { return; } $notification = $this->createNotification($jobExecution); $this->notifier->notify($notification, [$user]); }
/** * Send a user notification to given users * * @param NotificationInterface $notification * @param string[]|UserInterface[] $users Users which have to be notified * * @return NotificationManager * * @deprecated will be removed in 1.7. Please use Pim\Bundle\NotificationBundle\Notifier::notify() */ public function notify(NotificationInterface $notification, array $users) { $this->notifier->notify($notification, $users); return $this; }