Created
June 8, 2009 06:12
-
-
Save nikz/125662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ActionMailer::Base | |
| cattr_accessor :delayed_mail_handler | |
| class << self | |
| def method_missing_with_delayed_mail_handling(name, *args) | |
| if @@delayed_mail_handler | |
| @@delayed_mail_handler.to_s.classify.constantize.handle_mail(self, name, *args) | |
| else | |
| method_missing_without_delayed_mail_handling(name, *args) | |
| end | |
| end | |
| alias_method_chain :method_missing, :delayed_mail_handling | |
| def deliver_delayed_mail(name, *args) | |
| new(name, *args).deliver! | |
| end | |
| end | |
| end | |
| ActionMailer::Base.delayed_mail_handler = :sqs_mail_handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment