Rails 3 / Imagine Running a Forgotten Password from a Model Method

Its pretty simple: how do I run rails to send a forgotten password by email:

def send_invitation raise "Tell devise to send email" end 

This is where I need to send an email. This works on several occasions, but I need it to work ...

Sort of

 def send_invitation DeviseMailer.forgotten_password.deliver end 

This is not the right code, I don’t even know where to look

+4
source share
1 answer

It is send_reset_password_instructions , you can find it by looking at the class documentation you add by specifying recoverable in the Recoverable documentation model. The same applies to other Devise parameters, such as confirmable too.

+5
source

Source: https://habr.com/ru/post/1390572/


All Articles