Skip to content

Instantly share code, notes, and snippets.

@ilake
Created January 27, 2012 05:04
Show Gist options
  • Save ilake/1687098 to your computer and use it in GitHub Desktop.
Save ilake/1687098 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
@85636682
Copy link

my project can not work for this!
have anything need to edit?

@ilake
Copy link
Author

ilake commented Mar 15, 2012

This the original sorcery method

  def generic_send_email(method, mailer)
    config = sorcery_config
    mail = config.send(mailer).send(config.send(method),self)
    if defined?(ActionMailer) and config.send(mailer).superclass == ActionMailer::Base
      mail.deliver
    end
  end

That is very simple overwrite, so I am not sure your problem, maybe you should check all your setting

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