Changing who receives Membership Request emails



I was looking at the source code trying to determine if it was possible to change the email recipient of the Membership Requests emails. In MembershipRequest.cs there are a number of Methods that use the SendEmail code. My question is by replacing the current 'request.UserEmail' with 'SPContect.Current.Web.CurrentUser.Email' will that alone change the recipient? Also if that works, what steps are necessary to create the deployment package so I can test the changes. Thanks!


That will replace the email address with the currently logged in user's email address. Since the user who is requesting access is likely accessing sharepoint anonymously, that wouldn't work.  But if the person using the web part is a logged in user, and you want that user to receive the email, then yes it will work.  If you want the email address to be configurable, take a look at Code\MembershipSettings.cs - that's where I store configurable values. You can then edit the values with this:, or add them to the FBA Site Configuration Page.

As for the deployment package - Just click Package in Visual Studio 2010 and the WSP will be created, which you can deploy with the existing deployment scripts.


Excellent - In my situation only logged in users are able to request memberships (for new users). Thanks for the info on the location to modify the email address configuration. I appreciate the quick response - keep up the great work!