Esempio n. 1
0
 /**
  * @param \Venne\Queue\Job $job
  * @param integer $priority
  */
 public function run(Job $job, $priority)
 {
     $user = $this->userRepository->find($job->arguments['user']);
     $notificationUser = $this->notificationUserRepository->find($job->arguments['notification']);
     $notification = $notificationUser->getNotification();
     $this->emailManager->send($user->email, $user->name, NotificationEvent::getName(), 'userNotification', array('type' => $notification->type->type, 'action' => $notification->type->action, 'message' => $notification->type->message, 'user' => $notification->user, 'notification' => $notification, 'notificationManager' => $this));
 }
Esempio n. 2
0
 public function postPersist(Invitation $entity, LifecycleEventArgs $event)
 {
     if (!self::$lock) {
         self::$lock = true;
         $this->emailManager->send($entity->email, null, InvitationEvent::getName(), 'invitation', array('link' => $this->application->presenter->link('//:Admin:System:Login:default', array('registration' => $entity->registration->id, 'hash' => $entity->hash))));
         $this->notificationManager->notify(InvitationEvent::getName(), $entity, 'invitation', 'User has been invited.');
         self::$lock = false;
     }
 }
Esempio n. 3
0
 /**
  * @param \Venne\Security\User $user
  * @param string $link
  * @param \Venne\Security\User|null $sendBy
  */
 public function sendRecoveryUrl(User $user, $link, User $sendBy = null)
 {
     $sendBy = $sendBy !== null ? $sendBy : $user;
     $this->emailManager->send($user->getEmail(), null, PasswordRecoveryEvent::getName(), 'passwordRecovery', array('link' => $link));
     $this->notificationManager->notify(PasswordRecoveryEvent::getName(), $user, 'passwordRecovery', 'Password recovery URL has been sent.', $sendBy);
 }