# 如何更改用户电子邮件，如果电子邮件帐户已被删除

**URL:** https://meta.discourse.org/t/how-to-change-user-email-if-email-account-has-been-deleted/173434
**Category:** Support
**Created:** [2020年十二月15日 23:59 UTC](https://meta.discourse.org/t/how-to-change-user-email-if-email-account-has-been-deleted/173434 "2020-12-15T23:59:09Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2020年十二月16日 00:15 UTC](https://meta.discourse.org/t/how-to-change-user-email-if-email-account-has-been-deleted/173434/2 "2020-12-16T00:15:08Z")

</div>

这需要通过 Rails 控制台完成，这里有一份操作指南：

> [@Can an admin change a user's email address?](https://meta.discourse.org/t/can-an-admin-change-a-users-email-address/24525/24?u=awesomerobot):
>
> 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 …

---

_[View the full topic](https://meta.discourse.org/t/how-to-change-user-email-if-email-account-has-been-deleted/173434)._
