Posted on 12/04/2016 23:55:31
If you allow the same email on multiple users, I see the problem. I thought you meant to check if a user was member of a specific group before you allowed the mail from a specific website.
Dynamicweb will find all users with the specified email address in forgot password, and send a mail for each of them - so if you have multiple records, you have an issue.
But - if you submit the Forgotpassword request to a page with permissions, only users with permissions to that page will receive an email. So if you have 2 users with the same email address, but member of 2 different groups, and you submit the forgot password to 2 different pages with 2 different set of permissions, only one user will receive an email.
Hope that makes sense.
***********************
Another, somewhat hacky, suggestion is this:
- In your OnBeforeForgotPassword notification subscriber, find all users with the passed email address. (select * from accessuser where AccessUserEmail = 'some@other.com')
- Locate the records that should not receive the email
- Update accessuser set AccessUserEmail=Base.MD5HashToString('some@other.com') where AccessUserID IN (1,2,3) - the user IDs that should not have an email
- Now you should have only one record on the DB with that email
- Let DW send the email and do whatever it needs
- In a Notifications.Standard.Page.OnOutput notification subscriber, Update accessuser set AccessUserEmail='some@other.com' where AccessUserEmail =Base.MD5HashToString('some@other.com')
Pretty nasty, but I think it would work as an alternative.
BR Nicolai