Delay and or resend Devise's confirmation email for manually created users

后端 未结 7 1960
予麋鹿
予麋鹿 2021-01-30 22:37

I\'m using Devise to allow user signup as-well-as using my own user admin to create users manually. When I create a user in the admin, Devise sends a confirmati

7条回答
  •  温柔的废话
    2021-01-30 22:40

    We do this in one of our apps. You can tell Devise NOT to automatically deliver the confirmation like this:

    @user.skip_confirmation!
    

    And then later, you can do

    Devise::Mailer.confirmation_instructions(@user).deliver
    

    For Rails 2.x you'd do something like:

    DeviseMailer.deliver_confirmation_instructions(@user)
    

提交回复
热议问题