mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add action_mailer observer and interceptors configuration options
This commit is contained in:
parent
366ffd8164
commit
5acf76d173
2 changed files with 15 additions and 5 deletions
|
@ -213,14 +213,14 @@ module ActionMailer #:nodoc:
|
||||||
# = Observing and Intercepting Mails
|
# = Observing and Intercepting Mails
|
||||||
#
|
#
|
||||||
# Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
|
# 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.
|
# 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
|
# 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.
|
# in Mail::Message instance.
|
||||||
#
|
#
|
||||||
# = Default Hash
|
# = 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" ]
|
:parts_order => [ "text/plain", "text/enriched", "text/html" ]
|
||||||
</ruby>
|
</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+:
|
There is a single configuration setting available on +config.active_resource+:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue