Skip to content

Instantly share code, notes, and snippets.

@teeparham
Last active September 28, 2015 03:18
Show Gist options
  • Save teeparham/1375726 to your computer and use it in GitHub Desktop.
Save teeparham/1375726 to your computer and use it in GitHub Desktop.
Devise Resque Mailer
module Resque
module Mailer
class MessageDecoy
def deliver
record = @args.first
resque.enqueue @mailer_class, @method_name, record.class.name, record.id
end
end
end
end
class DeviseResqueMailer < Devise::Mailer
include Resque::Mailer
def self.perform(action, class_name, id)
record = class_name.constantize.find(id)
self.send(:new, action, record).message.deliver
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment