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
Awesome, thanks! I recently migrated data from my old forum and when tried to manually reset passwords for my users (not too many of them), ran into error message. Discourse logs didn’t show anything, tried to rebuild app and it didn’t help. Then tried your script and now via outsourced email sending service (and Sidekiq) I see that these mails are sending out. So, thanks again!
Hiya, did you get anything to resolve this? I was about to try that script but have seen your message and now wonder if you manage to work this around.
No, it would be just a matter of user experience. We have been migrating our old vanilla forum and I think the best experience for the old users would be to receive an email saying “Hey, we migrated from our forum to a new platform. You can log in through this link: {link}”.
Hey, I don’t know if this is still the best place to ask this, but would you happen to know how long does the forgot password email last for? I know it expires in 4 or 3 days but I need to know because I’ll invite my users from an old forum and need to send a message notifying them that the email may be expired after n days so I need the specific time. Cheers