aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-07-06 22:51:31 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-07-06 22:51:32 -0300
commit3009c63da6eb4cb18a6f90b39562945d299b1c85 (patch)
treee25f698112f5a826bf1e0015175bc876f59cc91f
parent842f27dd8227289ab4fd232bf89944584ad38fae (diff)
downloadrails-3009c63da6eb4cb18a6f90b39562945d299b1c85.tar.gz
rails-3009c63da6eb4cb18a6f90b39562945d299b1c85.tar.bz2
rails-3009c63da6eb4cb18a6f90b39562945d299b1c85.zip
Improve docs, changelog and release notes for Action Mailer default_options=
[ci skip]
-rw-r--r--actionmailer/CHANGELOG.md4
-rw-r--r--actionmailer/lib/action_mailer/base.rb10
-rw-r--r--guides/source/4_0_release_notes.textile2
-rw-r--r--guides/source/configuring.textile4
4 files changed, 14 insertions, 6 deletions
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index 177dc8109f..96cfb43e0b 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -1,11 +1,11 @@
## Rails 4.0.0 (unreleased) ##
+* Allow to set default Action Mailer options via `config.action_mailer.default_options=` *Robert Pankowecki*
+
* Raise an `ActionView::MissingTemplate` exception when no implicit template could be found. *Damien Mathieu*
* Asynchronously send messages via the Rails Queue *Brian Cardarella*
-* Set default Action Mailer options via config.action_mailer.default_options= *Robert Pankowecki*
-
## Rails 3.2.5 (Jun 1, 2012) ##
* No changes.
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index ea9a08102f..150d435140 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -278,6 +278,11 @@ module ActionMailer #:nodoc:
# set something in the defaults using a proc, and then set the same thing inside of your
# mailer method, it will get over written by the mailer method.
#
+ # It is also possible to set these default options that will be used in all mailers through
+ # the <tt>default_options=</tt> configuration in <tt>config/application.rb</tt>:
+ #
+ # config.action_mailer.default_options = { from: "no-reply@example.org" }
+ #
# = Callbacks
#
# You can specify callbacks using before_filter and after_filter for configuring your messages.
@@ -421,8 +426,9 @@ module ActionMailer #:nodoc:
self.default_params = default_params.merge(value).freeze if value
default_params
end
- #Alias so that we can use it in config/application.rb which requires setters
- #: config.action_mailer.default_options = {from: "no-replay@example.org"}
+ # Allows to set defaults through app configuration:
+ #
+ # config.action_mailer.default_options = { from: "no-reply@example.org" }
alias :default_options= :default
# Receives a raw email, parses it into an email object, decodes it,
diff --git a/guides/source/4_0_release_notes.textile b/guides/source/4_0_release_notes.textile
index 8415f6f83a..3733fec950 100644
--- a/guides/source/4_0_release_notes.textile
+++ b/guides/source/4_0_release_notes.textile
@@ -112,6 +112,8 @@ h4(#railties_deprecations). Deprecations
h3. Action Mailer
+* Allow to set default Action Mailer options via <tt>config.action_mailer.default_options=</tt>.
+
* Raise an <tt>ActionView::MissingTemplate</tt> exception when no implicit template could be found.
* Asynchronously send messages via the Rails Queue.
diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile
index d69235a9ab..cd9aab4892 100644
--- a/guides/source/configuring.textile
+++ b/guides/source/configuring.textile
@@ -424,12 +424,12 @@ There are a number of settings available on +config.action_mailer+:
* +config.action_mailer.perform_deliveries+ specifies whether mail will actually be delivered and is true by default. It can be convenient to set it to false for testing.
-* +config.action_mailer.default_options+ configures Action Mailer defaults. Use to set options like `from` or `replay_to` for every mailer. These default to:
+* +config.action_mailer.default_options+ configures Action Mailer defaults. Use to set options like `from` or `reply_to` for every mailer. These default to:
<ruby>
:mime_version => "1.0",
:charset => "UTF-8",
:content_type => "text/plain",
-:parts_order => [ "text/plain", "text/enriched", "text/html" ],
+:parts_order => [ "text/plain", "text/enriched", "text/html" ]
</ruby>
* +config.action_mailer.observers+ registers observers which will be notified when mail is delivered.