I want to manually send a Devise confirmation email to a user of my app. Like this:
u = User.last
Devise::Mailer.confirmation_instructions u
but Devise's confirmation_instructions
takes three parameters, the second being a token (according to the documentation) and the third being a Hash. How do I get it in order to be able to send these emails?
Here’s where the ConfirmationsController
sends the email:
self.resource = resource_class.send_confirmation_instructions(resource_params)
Have you tried this?
u.send_confirmation_instructions
EDIT to add Devise::Mailer
-based method:
u.send(:generate_confirmation_token)
Devise::Mailer.confirmation_instructions(u, u.instance_variable_get(:@raw_confirmation_token))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With