5

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

I found a function password_controller#creat :

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

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

I want to alter it like :

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

OK, it will return Syntax error...

Help me.. I don't know how to solve it.. thx.

Brad Koch
  • 19,267
  • 19
  • 110
  • 137
ethan
  • 620
  • 1
  • 6
  • 25

2 Answers2

2

I use the delayed_job_mailer plugin to accomplish this.

Alex Korban
  • 14,916
  • 5
  • 44
  • 55
1

on console:

Devise::Mailer.delay.confirmation_instructions(self.resource)
akbarbin
  • 4,985
  • 1
  • 28
  • 31
  • This answer would be much more helpful if you explained what this does. – Brad Koch Jun 09 '13 at 05:15
  • please try in rails c. self.resource is object user that want to send confirmation email. for example: user = User.first Devise::Mailer.delay.confirmation_instructions(user) – akbarbin Jun 18 '13 at 10:29