brockallen / BrockAllen.MembershipReboot

MembershipReboot is a user identity management and authentication library.
Other
742 stars 238 forks source link

Restrict specific EmailAccountEvents #664

Closed gilm0079 closed 8 years ago

gilm0079 commented 8 years ago

We have a system that creates MR account via the userAccountService.CreateAccount. When created this way they don't want the initial Account Verification email to be sent out to the user. I have the EmailAccountEventsHandler registered because then the forgot password mechanism will work. It seems though that this event handler contains all the account email events. Is the correct way to handle this scenario to create a custom EmailAccountEventsHandler that inherits from the EmailAccountEventsHandler, check the UserAccountEvent type and selectively not run the base.Process if it is the email we don't want to send? Or am I missing a better way to do this? Thanks in advance.

Also, in the EmailAccountEventsHandler.Process what is the "extra" object for?

brockallen commented 8 years ago

When created this way they don't want the initial Account Verification email to be sent out to the user.

I can't tell if you found a workaround, but my suggestion is to use a different MR Config for that instance of the UserAccountService (IOW, don't register for that event).