From cefc136ec332e5e065a2f4dd184d6fec0ea3c2ba Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Mon, 22 Feb 2010 12:17:08 +1100 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionmailer/lib/action_mailer/base.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionmailer/lib') 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 application/pdf 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 :delivered_email(message) method which will be + # called once for every email sent after the email has been sent. + # + # An interceptor object must implement the :delivering_email(message) 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: -- cgit v1.2.3