Hello first time umbracian here, making my debut on the forums! ;)
Im building a web shop wherein retailers have the possiblity to edit and update their customers, I've built a standard form where the retailer can change member properties for their customer like name, email, shipping information and so on, but I can't find a way to programmatically change the member's login name.
Im retrieving the member using the MemberService found in Umbraco.Core but can't find no way to get/set the login name.
Code snippet:
// Update umbraco member
var member = Services.MemberService.GetByUsername(customer.LoginName);
member.SetValue("firstName", model.FirstName);
member.SetValue("lastName", model.LastName);
member.Email = model.Email;
// change member login to match member email (email is login name)
Services.MemberService.Save(member);
I did some searching on the forums before I decided to create this post and most topics were a couple of years of old and didn't provide a solid answer to this question, maybe some of the more seasoned Umbraco devs could help me out?
Changing member login name programmatically
Hello first time umbracian here, making my debut on the forums! ;)
Im building a web shop wherein retailers have the possiblity to edit and update their customers, I've built a standard form where the retailer can change member properties for their customer like name, email, shipping information and so on, but I can't find a way to programmatically change the member's login name.
Im retrieving the member using the MemberService found in Umbraco.Core but can't find no way to get/set the login name.
Code snippet:
I did some searching on the forums before I decided to create this post and most topics were a couple of years of old and didn't provide a solid answer to this question, maybe some of the more seasoned Umbraco devs could help me out?
// Mathias
Hi, hopefully this helps.
I'm pretty sure that will change the members login to the value set for the username.
Thanks a lot buddy, i feel silly that i didn't spot that myself :S
is working on a reply...