Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3/Devise how to trigger the forgotten password from a model method

Its pretty simple: how do I trigger rails to send the forgotten password email:

def send_invitation
     raise "Tell devise to send email"
end

Thats where I need to send the email from. That gets triggered in few instances but I need it to work...

Something like

def send_invitation
   DeviseMailer.forgotten_password.deliver
end

Thats not the right code, I don't even know where to look

like image 775
TJ Sherrill Avatar asked Jan 12 '12 04:01

TJ Sherrill


1 Answers

It's send_reset_password_instructions, you can find it by looking at the class documentation that you add when you specify recoverable in the model, Recoverable documentation. The same is true for the other Devise options such as confirmable too.

like image 161
Zachary Anker Avatar answered Nov 14 '22 20:11

Zachary Anker