Permalink
Browse files

Add action_mailer observer and interceptors configuration options

  • Loading branch information...
1 parent 366ffd8 commit 5acf76d17371250857cd2396c46252dd0b550cf4 Paco Guzman committed Jun 7, 2011
Showing with 15 additions and 5 deletions.
  1. +4 −4 actionmailer/lib/action_mailer/base.rb
  2. +11 −1 railties/guides/source/configuring.textile
@@ -213,14 +213,14 @@ module ActionMailer #:nodoc:
# = Observing and Intercepting Mails
#
# Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
- # register objects that are called during the mail delivery life cycle.
+ # register classes that are called during the mail delivery life cycle.
#
- # An observer object must implement the <tt>:delivered_email(message)</tt> method which will be
+ # An observer class 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
+ # An interceptor class 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 any needed modifications directly to the passed
+ # the delivery agents. Your class should make any needed modifications directly to the passed
# in Mail::Message instance.
#
# = Default Hash
@@ -364,7 +364,17 @@ There are a number of settings available on +config.action_mailer+:
:parts_order => [ "text/plain", "text/enriched", "text/html" ]
</ruby>
-h4. Configuring Active Resource
+* +config.action_mailer.observers+ registers observers which will be notified when mail is delivered.
+<ruby>
+config.active_record.observers = ["MailObserver"]
+</ruby>
+
+* +config.action_mailer.interceptors+ registers interceptors which will be called before mail is sent.
+<ruby>
+config.active_record.interceptors = ["MailInterceptor"]
+</ruby>
+
+ h4. Configuring Active Resource
There is a single configuration setting available on +config.active_resource+:

0 comments on commit 5acf76d

Please sign in to comment.