The first thing I did was creating a EmailConfirmationListener. You can copy this file from the FOSUserBundle in the vender's folder. All I did was 1) setting user isEnabled flag to true and 2) changing the route (if needed).
Note that the EmailConfirmationListener registers the following event:
FOSUserEvents::REGISTRATION_SUCCESS => 'onRegistrationSuccess'When I registered a new user, I registered two activation emails were be sent.
The trace log shows that two onRegistrationSuccess events were fired. One is the one from the vendor, the other one is the one I just created.
The listener service is declared in email_confirmation.xml.
Doing a quick search on the project root folder for the term "email_confirmation.xml" reveals the following:
if ($config['confirmation']['enabled']) {Now turn the confirmation setting to false in config.yml
$loader->load('email_confirmation.xml');
}
fos_user:
registration:
confirmation:
enabled: true
Then only one onRegistrationSuccess event would be fired.
No comments:
Post a Comment