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

后端 未结 7 2027
予麋鹿
予麋鹿 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:49

    I just spent some time looking into this, basically you just need to add this and setup delayed_job.

    def send_confirmation_instructions
      generate_confirmation_token! if self.confirmation_token.nil?
      ::Devise.mailer.delay.confirmation_instructions(self)
    end
    

    Add it in your user model as protected method to override the devise one in confirmable. Also, note the gem was just updated to add a new method to be overridden on create that sends the confirmation instructions.

提交回复
热议问题