diff --git a/config/deploy.rb b/config/deploy.rb index 3129cfd38..5689f7e26 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -21,7 +21,7 @@ set :log_level, :info set :pty, true set :use_sudo, false -set :linked_files, %w[config/database.yml config/secrets.yml config/environments/production.rb] +set :linked_files, %w[config/database.yml config/secrets.yml] set :linked_dirs, %w[log tmp public/system public/assets public/ckeditor_assets] set :keep_releases, 5 diff --git a/config/environments/preproduction.rb b/config/environments/preproduction.rb index 78a443249..17e1b9439 100644 --- a/config/environments/preproduction.rb +++ b/config/environments/preproduction.rb @@ -71,17 +71,11 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: Rails.application.secrets.server_name } config.action_mailer.asset_host = "https://#{Rails.application.secrets.server_name}" - # SMTP configuration to deliver emails - # Uncomment the following block of code and add your SMTP service credentials - # config.action_mailer.delivery_method = :smtp - # config.action_mailer.smtp_settings = { - # address: "smtp.example.com", - # port: 587, - # domain: "example.com", - # user_name: "", - # password: "", - # authentication: "plain", - # enable_starttls_auto: true } + # Configure your SMTP service credentials in secrets.yml + if Rails.application.secrets.smtp_settings + config.action_mailer.delivery_method = Rails.application.secrets.mailer_delivery_method || :smtp + config.action_mailer.smtp_settings = Rails.application.secrets.smtp_settings + end # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). diff --git a/config/environments/production.rb b/config/environments/production.rb index 6c23b8ab5..245973eb9 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -72,17 +72,11 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: Rails.application.secrets.server_name } config.action_mailer.asset_host = "https://#{Rails.application.secrets.server_name}" - # SMTP configuration to deliver emails - # Uncomment the following block of code and add your SMTP service credentials - # config.action_mailer.delivery_method = :smtp - # config.action_mailer.smtp_settings = { - # address: "smtp.example.com", - # port: 587, - # domain: "example.com", - # user_name: "", - # password: "", - # authentication: "plain", - # enable_starttls_auto: true } + # Configure your SMTP service credentials in secrets.yml + if Rails.application.secrets.smtp_settings + config.action_mailer.delivery_method = Rails.application.secrets.mailer_delivery_method || :smtp + config.action_mailer.smtp_settings = Rails.application.secrets.smtp_settings + end # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 8e64e9fae..65a15f2b5 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -71,17 +71,11 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: Rails.application.secrets.server_name } config.action_mailer.asset_host = "https://#{Rails.application.secrets.server_name}" - # SMTP configuration to deliver emails - # Uncomment the following block of code and add your SMTP service credentials - # config.action_mailer.delivery_method = :smtp - # config.action_mailer.smtp_settings = { - # address: "smtp.example.com", - # port: 587, - # domain: "example.com", - # user_name: "", - # password: "", - # authentication: "plain", - # enable_starttls_auto: true } + # Configure your SMTP service credentials in secrets.yml + if Rails.application.secrets.smtp_settings + config.action_mailer.delivery_method = Rails.application.secrets.mailer_delivery_method || :smtp + config.action_mailer.smtp_settings = Rails.application.secrets.smtp_settings + end # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). diff --git a/config/secrets.yml.example b/config/secrets.yml.example index 3a8678766..d0c896c0f 100644 --- a/config/secrets.yml.example +++ b/config/secrets.yml.example @@ -44,6 +44,15 @@ staging: preproduction: secret_key_base: "" server_name: "" + # mailer_delivery_method: "smtp" + # smtp_settings: + # address: "smtp.example.com" + # port: 25 + # domain: "your_domain.com" + # user_name: "" + # password: "" + # authentication: "plain" + # enable_starttls_auto: true rollbar_server_token: "" http_basic_username: "" http_basic_password: "" @@ -61,6 +70,15 @@ preproduction: production: secret_key_base: "" server_name: "" + # mailer_delivery_method: "smtp" + # smtp_settings: + # address: "smtp.example.com" + # port: 25 + # domain: "your_domain.com" + # user_name: "" + # password: "" + # authentication: "plain" + # enable_starttls_auto: true rollbar_server_token: "" http_basic_username: "" http_basic_password: ""