# Send password reset emails in bulk?

**URL:** <https://meta.discourse.org/t/send-password-reset-emails-in-bulk/241012>\
**Category:** Support\
**Created:** [2월 5, 2018, 11:21오전 UTC](https://meta.discourse.org/t/send-password-reset-emails-in-bulk/241012 "2018-02-05T11:21:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Overgrow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overgrow/32/478189_2.png) [@Overgrow](https://meta.discourse.org/u/Overgrow)\
**Post date:** [2월 5, 2018, 11:21오전 UTC](https://meta.discourse.org/t/send-password-reset-emails-in-bulk/241012/1 "2018-02-05T11:21:04Z")

</div>

I have migrated users from old forum database. Is there any way to send password reset e-mails in bulk? I’ve tried to use API but got `You have performed this action too many times, try again later.` after requesting to send about 3 reset emails.. (other API actions work fine)

I’d be happy to use ruby console or API if you can please advise how to go around that rate limit. It is probably limit per IP address as I’ve investigated.

[updated]

Seems like `RateLimiter` for ‘forgot\_password’ is unfortunately hardcoded so I went ruby script way…

For mass reseting (sending out tokens for password reset to all users) you can do

```
cd /var/discourse
./launcher enter app

```

Then create new file ` mass-password-reset.rb` using your favourite editor with following script:

```
User.all.each do |u|
  email_token = u.email_tokens.create(email: u.email)
  Jobs.enqueue(:critical_user_email, type: :forgot_password, user_id: u.id, email_token: email_token.token)
  sleep(5)
end

```

And then run it with `rails r mass-password-reset.rb`

---

_[View the full topic](https://meta.discourse.org/t/send-password-reset-emails-in-bulk/241012)._
