fix more sensible mailer option defaults
This commit is contained in:
parent
1c878c3c13
commit
03b307d359
1 changed files with 4 additions and 8 deletions
|
@ -4,15 +4,11 @@
|
||||||
require 'foodsoft_config'
|
require 'foodsoft_config'
|
||||||
FoodsoftConfig.init
|
FoodsoftConfig.init
|
||||||
|
|
||||||
# Set action mailer default host for url generating
|
|
||||||
url_options = {
|
|
||||||
:host => FoodsoftConfig[:host],
|
|
||||||
:protocol => FoodsoftConfig[:protocol]
|
|
||||||
}
|
|
||||||
url_options.merge!({:port => FoodsoftConfig[:port]}) if FoodsoftConfig[:port]
|
|
||||||
|
|
||||||
Foodsoft::Application.configure do
|
Foodsoft::Application.configure do
|
||||||
config.action_mailer.default_url_options = url_options
|
# Set action mailer default host for url generating
|
||||||
|
[:protocol, :host, :port].each do |k|
|
||||||
|
config.action_mailer.default_url_options[k] = FoodsoftConfig[k] if FoodsoftConfig[k]
|
||||||
|
end
|
||||||
|
|
||||||
if %w(production).include? Rails.env
|
if %w(production).include? Rails.env
|
||||||
# Configuration of the exception_notification plugin
|
# Configuration of the exception_notification plugin
|
||||||
|
|
Loading…
Reference in a new issue