# Changing Email address of unregistered account for activation

**URL:** https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615
**Category:** Bug
**Created:** [21 Julio, 2017 20:09 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615 "2017-07-21T20:09:22Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![youwiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youwiki/32/89936_2.png) [@youwiki](https://meta.discourse.org/u/youwiki)
#### Post date: [21 Julio, 2017 20:09 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/1 "2017-07-21T20:09:22Z")

</div>

Hello!  
If we change email for activation registered account too quiqly then `enqueue_activation_email` method of `users_controller` enqueue job without delay, so we got message to old email. May be it should be something that:

> Jobs.enqueue\_in(2.second, :critical\_user\_email, type: :signup, user\_id: @user.id, email\_token: @email\_token.token)

or may be it possible to set low priority to that job?  
Thanks!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [21 Julio, 2017 23:17 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/2 "2017-07-21T23:17:14Z")

</div>

Can you describe exactly how you are doing this? Through the API or through the user interface by clicking / tapping buttons, etc?

---

<div class="post-metadata">

### Author: ![youwiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youwiki/32/89936_2.png) [@youwiki](https://meta.discourse.org/u/youwiki)
#### Post date: [22 Julio, 2017 20:53 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/3 "2017-07-22T20:53:20Z")

</div>

I do it through the user interface, by clicking on change email button for sending activation message after account registration. Paste other email-address at once, but receive message to old email. Same if click on back button in browser and type new email. If i do delay, then all is ok.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [22 Julio, 2017 22:30 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/4 "2017-07-22T22:30:33Z")

</div>

Are you attempting to change password on a staff account? This requires verifying both old AND new emails for security reasons.

---

<div class="post-metadata">

### Author: ![youwiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youwiki/32/89936_2.png) [@youwiki](https://meta.discourse.org/u/youwiki)
#### Post date: [22 Julio, 2017 22:40 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/5 "2017-07-22T22:40:56Z")

</div>

I attempt to change an email-address of newly created account, that not activated yet.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [22 Julio, 2017 22:45 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/6 "2017-07-22T22:45:49Z")

</div>

Can you repro this @techapj?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [24 Julio, 2017 17:38 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/7 "2017-07-24T17:38:39Z")

</div>

Yes, I can repro this issue on try. Added on my list to fix 📝

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [31 Julio, 2017 12:01 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/8 "2017-07-31T12:01:20Z")

</div>

Fixed via:

[https://github.com/discourse/discourse/commit/2e2b5e28aa6711a549715a3892f062981546c270](https://github.com/discourse/discourse/commit/2e2b5e28aa6711a549715a3892f062981546c270)

Thanks for reporting this issue @youwiki 👍

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [31 Julio, 2017 12:01 UTC](https://meta.discourse.org/t/changing-email-address-of-unregistered-account-for-activation/66615/9 "2017-07-31T12:01:29Z")

</div>


