rails/rails — pull request #6950 by paneq (2012-07-03 22:17:05+00:00)
Title: 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")