Rails devise send password reset mail as delayed work

I want to install the rails devise 'reset_password_instructions plugin on delayed_job .. but I tried many ways and failed.

I found the password_controller # creat function:

self.resource = resource_class.send_reset_password_instructions(params[resource_name])

I think the sentence used to send email to password reset.

I want to change it as:

self.resource =  Delayed::Job.enqueue ApplicationController::MailingJob.new(:resource_class.send_reset_password_instructions, params[resource_name])

OK, it will return a syntax error ...

Help me .. I don’t know how to solve it .. thanks.

+5
source share
2 answers

I am using the delayed_job_mailer plugin to accomplish this.

+2
source

on the console:

Devise::Mailer.delay.confirmation_instructions(self.resource)
+1

All Articles