Can an admin change a user's email address?

If you have access to the site’s rails console, you can change email addresses without triggering a confirmation email.

Enter the docker container and then launch the rails console:

./launcher enter app 
rails c

Then find the user from their current email address:

u = User.find_by_email('oldemail@example.com')

Then update the email address:

u.update(email: 'newemail@example.com')

EDIT:
After updating the user’s email address though the command line, go to the Admin / Users page for the user. In the Permissions section of that page, click the ‘Deactivate Account’ button. You will then see two new buttons, ‘Send Activation Email’, and ‘Activate Account.’ Click the ‘Send Activation Email’ button. This will send the ‘Welcome to Discourse!’ email to the new email address. The user can click the link in that email to reaccess their account.

If the user is an Admin, you’ll have to Revoke Admin access first to be able to Deactivate Account.

12 Likes