You probably figured this out by now but for the benefit of anyone still seeking for an answer, this works for me on 7.1.8:
// Initialise member service
var memberServices = new MemberService(new RepositoryFactory(), new MemberGroupService(new RepositoryFactory()));
// Create new member
var newMem = memberServices.CreateMember(model.Email, model.Email, model.Name, "Member Type Alias");
// Custom properties for new member
newMem.SetValue("Property", model.Property);
// Set approved to false
newMem.SetValue("umbracoMemberApproved", false);
// Save new member
memberServices.Save(newMem);
// Add to groups if necessary
memberServices.AssignRole(newMem.Id, "Member Group Name");
How set umbracoMemberApproved to false by default?
How can I set the umbracoMemberApproved propertie to false in RegisterMember.cshtml by default in Umbraco 7?
Best regards
Sören
Did anybody solve this problem?
How can I set the umbracoMemberApproved propertie to false in RegisterMember.cshtml by default in Umbraco 7?
You probably figured this out by now but for the benefit of anyone still seeking for an answer, this works for me on 7.1.8:
Hi Julio,
thank you for this code :-) I will test this next week and give you an answer.
Sören
is working on a reply...