When the config setting useEmailAsUsername is set, I would expect updating a users' email address to also update the username field when saving the element. However, this does not occur unless you manually call php craft utils/update-usernames.

Should the username be updated when a users' email address is updated?

Is there a method to trigger this for the current user via a plugin or do I just need to update username alongside email?


Edit: This also prevents registration of a new user with the previous email address but does not indicate what the problem is clearly.

enter image description here

  • This feels like half-bug/half-feature request to me as I could see where people might want both behaviors. Can you make an issue for it? github.com/craftcms/cms/issues Going to go ahead and vote to close this here.
    – Brad Bell
    Feb 11, 2021 at 0:56
  • Thanks @BradBell, will do. As I was writing it I thought it might be more of a GitHub issue. Feb 11, 2021 at 1:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.