FOSUserBundle
FOSUserBundle copied to clipboard
Using user manager to create user doesn't trigger registration related events
Hi,
Due reason I can't use the default form implementation for creating users, so I used createUser and updateUser in the user manager. However, when using this, the different events regarding registration aren't triggered, while important configuration items (Like confirmation mails) depend on these events.
For now I copied the code from the registrationController, but this doesn't sound like the best solution.
Hi, I ran into this issue as well. Any way to trigger the events from fixtures ? ( this event depends on Request and Response )
I know this is very old but in an effort to help others and close this issue...
Inject Symfony\Component\EventDispatcher\EventDispatcherInterface
into your class.
Then trigger the event.
$this->dispatcher->dispatch(FOSUserEvents::USER_CREATED, new UserEvent($user, new Request()));