private function notifyUser(User $user, $datas) { $mailed = false; if ($this->shouldSendNotificationFor($user, 'eventsmanager_notify_uploadquarantine')) { $readyToSend = false; try { $receiver = Receiver::fromUser($user); $readyToSend = true; } catch (\Exception $e) { } if ($readyToSend) { $mail = MailInfoRecordQuarantined::create($this->app, $receiver); $this->deliver($mail); $mailed = true; } } $this->app['events-manager']->notify($user->getId(), 'eventsmanager_notify_uploadquarantine', $datas, $mailed); }
/** * Notifiy an user using the specified datas * * @param User $user * @param string $datas */ private function notifyUser(User $user, $datas) { $mailed = false; if ($this->shouldSendNotificationFor($user->getId())) { $readyToSend = false; try { $receiver = Receiver::fromUser($user); $readyToSend = true; } catch (\Exception $e) { } if ($readyToSend) { $mail = MailInfoRecordQuarantined::create($this->app, $receiver); $this->app['notification.deliverer']->deliver($mail); $mailed = true; } } $this->broker->notify($user->getId(), __CLASS__, $datas, $mailed); }
public function getMail() { return MailInfoRecordQuarantined::create($this->getApplication(), $this->getReceiverMock(), $this->getEmitterMock(), $this->getMessage()); }