diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-02-22 12:17:08 +1100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-22 09:15:48 +0100 |
commit | cefc136ec332e5e065a2f4dd184d6fec0ea3c2ba (patch) | |
tree | 29e16a141c759f64ba0b909e38cdb68f99628c4c /actionmailer/lib | |
parent | a6684eeb786663839cf383ea54b681d429a83177 (diff) | |
download | rails-cefc136ec332e5e065a2f4dd184d6fec0ea3c2ba.tar.gz rails-cefc136ec332e5e065a2f4dd184d6fec0ea3c2ba.tar.bz2 rails-cefc136ec332e5e065a2f4dd184d6fec0ea3c2ba.zip |
Adding options to register observers and interceptors through ActionMailer::Base.register_observer and ActionMailer::Base.register_interceptor. These hook into Mail.register_interceptor and Mail.register_observer. Also bumped Mail requirement to 2.1.3
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index ce13111850..e198543c34 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -181,6 +181,18 @@ module ActionMailer #:nodoc: # and the second being a <tt>application/pdf</tt> with a Base64 encoded copy of the file.pdf book # with the filename +free_book.pdf+. # + # = Observing and Intercepting Mails + # + # ActionMailer provides hooks into the Mail observer and interceptor methods. These allow you to + # register objects that are called during the mail delivery life cycle. + # + # An observer object must implement the <tt>:delivered_email(message)</tt> method which will be + # called once for every email sent after the email has been sent. + # + # An interceptor object must implement the <tt>:delivering_email(message)</tt> method which will be + # called before the email is sent, allowing you to make modifications to the email before it hits + # the delivery agents. Your object should make and needed modifications directly to the passed + # in Mail::Message instance. # # = Configuration options # @@ -265,6 +277,9 @@ module ActionMailer #:nodoc: include ActionMailer::OldApi include ActionMailer::DeprecatedApi + + delegate :register_observer, :to => Mail + delegate :register_interceptor, :to => Mail private_class_method :new #:nodoc: |