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