Hello every one ,
I have an issue , that I created a member created event , but its a saved event.
What is problem.
-
How I able to create an event that only fire when member account created , not fire when member prop. is updated or saved.
-
After making some changes in member property as like change information (name , address) , its stop working , none of change will be saved.
And I found following warning in log.text
Please share your idea , how I can fix it .
waiting for help…
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
Umbraco.Core.Services.MemberService.Saved += MemberService_Saved;
}
void MemberService_Saved(IMemberService sender, Umbraco.Core.Events.SaveEventArgs<IMember> e)
{
int count = 0;
string email= "" ;
string bname = "";
string pass ="";
string username ="";
foreach (var item in e.SavedEntities)
{
count++;
if (count == 1 && item.ContentTypeAlias == "mynh")
{
email = item.Email;
bname= item.Name;
pass=item.RawPasswordValue.ToString();
username= item.Username;
}
}
sendmail(email, bname, pass, username);
}
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/70434-member-saved-event-error