more sensible mailer option defaults
Conflicts: app/mailers/base_mailer.rb config/app_config.yml.SAMPLE spec/app_config.yml
This commit is contained in:
parent
ecf5601023
commit
63d52db91b
6 changed files with 17 additions and 11 deletions
|
@ -87,9 +87,11 @@ class Mailer < ActionMailer::Base
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
# @todo this global stuff gives threading problems when foodcoops have different values! - pass args to `url_for` instead
|
||||||
def set_foodcoop_scope(foodcoop = FoodsoftConfig.scope)
|
def set_foodcoop_scope(foodcoop = FoodsoftConfig.scope)
|
||||||
ActionMailer::Base.default_url_options[:protocol] = FoodsoftConfig[:protocol]
|
[:protocol, :host, :port].each do |k|
|
||||||
ActionMailer::Base.default_url_options[:host] = FoodsoftConfig[:host]
|
ActionMailer::Base.default_url_options[k] = FoodsoftConfig[k] if FoodsoftConfig[k]
|
||||||
|
end
|
||||||
ActionMailer::Base.default_url_options[:foodcoop] = foodcoop
|
ActionMailer::Base.default_url_options[:foodcoop] = foodcoop
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,6 @@ default: &defaults
|
||||||
# If multi_coop_install you have to use a coop name, which you you wanna be selected by default
|
# If multi_coop_install you have to use a coop name, which you you wanna be selected by default
|
||||||
default_scope: 'f'
|
default_scope: 'f'
|
||||||
|
|
||||||
# http config for this host
|
|
||||||
# Required for action mailer
|
|
||||||
protocol: http
|
|
||||||
host: localhost
|
|
||||||
port: 3000
|
|
||||||
|
|
||||||
# name of this foodcoop
|
# name of this foodcoop
|
||||||
name: FC Test
|
name: FC Test
|
||||||
# foodcoop contact information (used for FAX messages)
|
# foodcoop contact information (used for FAX messages)
|
||||||
|
@ -106,6 +100,11 @@ default: &defaults
|
||||||
sender_address: "\"Foodsoft Error\" <foodsoft@foodcoop.test>"
|
sender_address: "\"Foodsoft Error\" <foodsoft@foodcoop.test>"
|
||||||
email_prefix: "[Foodsoft]"
|
email_prefix: "[Foodsoft]"
|
||||||
|
|
||||||
|
# http config for this host to generate links in emails (uses environment config when not set)
|
||||||
|
#protocol: http
|
||||||
|
#host: localhost
|
||||||
|
#port: 3000
|
||||||
|
|
||||||
# Access to sharedLists, the external article-database
|
# Access to sharedLists, the external article-database
|
||||||
shared_lists:
|
shared_lists:
|
||||||
adapter: mysql2
|
adapter: mysql2
|
||||||
|
|
|
@ -33,8 +33,8 @@ Foodsoft::Application.configure do
|
||||||
# Required for i18n-js
|
# Required for i18n-js
|
||||||
config.assets.initialize_on_precompile = true
|
config.assets.initialize_on_precompile = true
|
||||||
|
|
||||||
# Configure hostname for action mailer
|
# Configure hostname for action mailer (can be overridden in foodcoop config)
|
||||||
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
config.action_mailer.default_url_options = { host: 'localhost', port: 3000, protocol: 'http' }
|
||||||
|
|
||||||
# Mailcatcher config, start mailcatcher from console with 'mailcatcher'
|
# Mailcatcher config, start mailcatcher from console with 'mailcatcher'
|
||||||
# Mailcatcher can be installed by gem install mailcatcher
|
# Mailcatcher can be installed by gem install mailcatcher
|
||||||
|
|
|
@ -75,6 +75,9 @@ Foodsoft::Application.configure do
|
||||||
# Disable automatic flushing of the log to improve performance.
|
# Disable automatic flushing of the log to improve performance.
|
||||||
# config.autoflush_log = false
|
# config.autoflush_log = false
|
||||||
|
|
||||||
|
# Configure hostname for action mailer (can be overridden in foodcoop config)
|
||||||
|
config.action_mailer.default_url_options = { host: `hostname -f`, protocol: 'https' }
|
||||||
|
|
||||||
# Use sendmail to avoid ssl cert problems
|
# Use sendmail to avoid ssl cert problems
|
||||||
config.action_mailer.delivery_method = :sendmail
|
config.action_mailer.delivery_method = :sendmail
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@ Foodsoft::Application.configure do
|
||||||
# Disable request forgery protection in test environment.
|
# Disable request forgery protection in test environment.
|
||||||
config.action_controller.allow_forgery_protection = false
|
config.action_controller.allow_forgery_protection = false
|
||||||
|
|
||||||
|
# Configure hostname for action mailer (can be overridden in foodcoop config)
|
||||||
|
config.action_mailer.default_url_options = { host: 'localhost', port: 3000, protocol: 'http' }
|
||||||
|
|
||||||
# Tell Action Mailer not to deliver emails to the real world.
|
# Tell Action Mailer not to deliver emails to the real world.
|
||||||
# The :test delivery method accumulates sent emails in the
|
# The :test delivery method accumulates sent emails in the
|
||||||
# ActionMailer::Base.deliveries array.
|
# ActionMailer::Base.deliveries array.
|
||||||
|
|
|
@ -8,7 +8,6 @@ default: &defaults
|
||||||
multi_coop_install: false
|
multi_coop_install: false
|
||||||
default_scope: 'f'
|
default_scope: 'f'
|
||||||
|
|
||||||
host: localhost
|
|
||||||
|
|
||||||
name: FC Minimal
|
name: FC Minimal
|
||||||
contact:
|
contact:
|
||||||
|
|
Loading…
Reference in a new issue