aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/configuring.textile
diff options
context:
space:
mode:
authorRobert Pankowecki <robert.pankowecki@gmail.com>2012-06-15 17:20:47 +0000
committerRobert Pankowecki <robert.pankowecki@gmail.com>2012-07-03 22:14:08 +0000
commitedaa2c48179681efd96d0cad4b5dea696a2a31fb (patch)
tree7c73de0aa021eb631ce39ece2f04fd98cc87a1a8 /guides/source/configuring.textile
parentb7a4fe18f2cee1385e7dcd36016fb6a15b93aef6 (diff)
downloadrails-edaa2c48179681efd96d0cad4b5dea696a2a31fb.tar.gz
rails-edaa2c48179681efd96d0cad4b5dea696a2a31fb.tar.bz2
rails-edaa2c48179681efd96d0cad4b5dea696a2a31fb.zip
Introduce config.action_mailer.default_from=
Allows to easily set :from, :replay_to, etc. options in config/application.rb using simple syntax: config.action_mailer.default_options = {from:"no-replay@example.org"} This was not possible using #default method because config.action_mailer.default(from: "no-replay@example.org") is interpreated as reader method and just returns nil. It would not call ActionMailer::Base.default method. The only way of calling this method from config/application.rb was to use the direct syntax which looks ugly in my opinion: config.assets.enabled = false config.assets.version = '1.0' config.encoding = "utf-8" config.action_mailer.default_url_options= { host:"example.org", protocol:"https" } ActionMailer::Base.default(from: "no-replay@example.org")
Diffstat (limited to 'guides/source/configuring.textile')
-rw-r--r--guides/source/configuring.textile4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile
index af46538bf5..d69235a9ab 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+ configures Action Mailer defaults. These default to:
+* +config.action_mailer.default_options+ configures Action Mailer defaults. Use to set options like `from` or `replay_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.