# Can an admin change a user's email address?

**URL:** https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525
**Category:** Support
**Tags:** email
**Created:** [Janvier 28, 2015, 1:37 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525 "2015-01-28T13:37:53Z")
**Posts on this page:** 7
**Page:** 2

<div class="post-metadata">

### Author: ![shahidmir](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shahidmir](https://meta.discourse.org/u/shahidmir)
#### Post date: [Mai 25, 2018, 8:08 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/22 "2018-05-25T08:08:58Z")

</div>

sorry, yes thats what i meant 🙂  
thanks

---

<div class="post-metadata">

### Author: ![adrelanos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adrelanos/32/121409_2.png) [@adrelanos](https://meta.discourse.org/u/adrelanos)
#### Post date: [Avril 2, 2019, 2:33 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/23 "2019-04-02T14:33:38Z")

</div>

As forum admin, I like to change the e-mail of a user. The user’s e-mail provider went out of business.

I know the user and the user is authenticated to me by authenticated e-mail (gpg / OpenPGP) so I have no doubts about the legitimacy of the request.

Discourse sends a verification e-mail to the old e-mail address which will never arrive. Hence, e-mail cannot be updated.

Any advice?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [Avril 2, 2019, 4:08 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/24 "2019-04-02T16:08:51Z")

</div>

> [@adrelanos](#):
>
> Discourse sends a verification e-mail to the old e-mail address which will never arrive. Hence, e-mail cannot be updated.

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:

```plaintext
./launcher enter app 
rails c

```

Then find the user from their current email address:

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

```

Then update the email address:

```plaintext
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`.

---

<div class="post-metadata">

### Author: ![adrelanos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adrelanos/32/121409_2.png) [@adrelanos](https://meta.discourse.org/u/adrelanos)
#### Post date: [Avril 3, 2019, 10:36 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/25 "2019-04-03T10:36:40Z")

</div>

This works initially but e-mail is subsequently automatically reset to old e-mail address.

User reported “This sends out new account creation confirmation.”

The old e-mail (provider no longer existing) is probably receiving a confirmation mail which the user cannot confirm. Hence, back to square one.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [Avril 3, 2019, 4:30 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/26 "2019-04-03T16:30:09Z")

</div>

> [@adrelanos](#):
>
> This works initially but e-mail is subsequently automatically reset to old e-mail address.

Are you using SSO to log users into Discourse?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [Avril 4, 2019, 12:01 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/27 "2019-04-04T00:01:43Z")

</div>

> [@adrelanos](#):
>
> User reported “This sends out new account creation confirmation.”

Sorry, you are right. I have used this method for updating email addresses for sites that are using SAML login, and it works. For sites using password logins you need to do one more step.

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 I find a more straightforward way of doing this, I’ll update my post.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [Décembre 31, 2019, 12:10 UTC](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/28 "2019-12-31T12:10:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525.md?page=1)
