Skip to content

Instantly share code, notes, and snippets.

@stefanobernardi
Forked from ilake/sorcery_async_email.rb
Created February 27, 2012 02:05
Show Gist options
  • Save stefanobernardi/1920719 to your computer and use it in GitHub Desktop.
Save stefanobernardi/1920719 to your computer and use it in GitHub Desktop.
Async Emails With Sorcery by delayed_job
#config/initializers/sorcery_async_email.rb
module Sorcery
module InstanceMethods
def generic_send_email(method, mailer)
config = sorcery_config
config.send(mailer).delay.send(config.send(method),self)
end
end
end
end
@xpepermint
Copy link

Hey... I still see errors when executing rake jobs:work (try adding delayed mail into it over sorcery):
Class#superclass failed with NoMethodError: undefined methoddeliver' for ActionMailer::Base:Class - 0 failed attempts`

The mail is sent but with this error.

@stefanobernardi
Copy link
Author

stefanobernardi commented Apr 30, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment