Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
For the first question: Hook into the CreateUserWizard.CreatedUser event to add the new user to a role in your event handler.
Hi,
I've stubled upon this issue, and it's wierd.
What I've found is this:
1.I create a user throught the asp:createuserwizard. Sending verification e-mail.
2.Verifying user, setting it active(ie IsApproved)
3. See that the user is activated in EPiServer admin
4. Checing the database to see that the user is registed in the aspnet_Membership table
5. Making the newly created user subscribe to something.
6. Run the subscription job.
7. Now this is where it gets wierd: The EPiServerProfile.Email is an empty string, the property EmailWithMembershipFallback has the correct email address....
If I go into admin mode and open the user and then save it, without doing nothing to it the EPiServerProfile.Email property is populated....
Anyone else seen this?
Regards,
Morten
At last - some replication of the problem. I think we are not too far away from determining the solution. In the last couple of days I have been able to determine the same as you find (although I had a slightly more complicated scenario ... because I had earlier thought that adding users to a subscribers group was part of the issue ... forwhich I added the following code to my OnCreatedUser hook of the createuserwizard - as suggested by @Magnus above)
protected void On_CreatedUser(object sender, EventArgs e)
{
// user has been created so add to subscribers role.
// get the username value from the wizard
string strUserName = RegistrationWizard.UserName.ToString();
if (!Roles.RoleExists("Subscribers")) {
Roles.CreateRole("Subscribers");
}
Roles.AddUserToRole(strUserName, "Subscribers");
}
I have just read this post which demonstrates the same - also from Magnus -
http://world.episerver.com/Forum/Pages/thread.aspx?id=29569
These are both highly related.
Now, to think about a solution:
I'm going to user the oncreateduser hook of the createuserwizard to also populate the EPiServerProfile.email with the registrants email address.
Keeping you posted...
And finally...
As discussed by Moten above the createuserwizard was not adding the user's email to their EPiServerProfile.Email.
I chose to change the subscription process so that after registration, a check for EPiServerProfile.Mail field being empty would result in users EmailWithMembershipFallback value being copied in to their EPiServerProfile.Mail field when confirming the subscriptions they require.
New registrants now receive email as expected.
Our subscription process is not sending external emails. This will be related to the mail server set up which is being looked at BUT my question lies here:
Is there a way to get more information for the logging generated during the subscription task running. Currently the only entry is:
2009-04-08 11:42:24,812 WARN [11] EPiServer.Personalization.SubscriptionMail.Send - 4.3.1 Invalid email address found (skip mail):
It is supposed to show the email that is skipped - but doesn't. I'd like to be able to get more info out of the logs.