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; } }
/** * @return string[] */ public function getEventTypes() { return array(InvitationEvent::getName()); }