From b6c3daa78115ce1c3c92ea1287e315de9137e0ef Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 3 Nov 2016 18:10:14 +0200 Subject: [PATCH 1/3] Fix invalid url in config sample --- config/application-example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application-example.yml b/config/application-example.yml index 9bdfb56f8..f1b17cc03 100644 --- a/config/application-example.yml +++ b/config/application-example.yml @@ -21,7 +21,7 @@ smtp_openssl_verify_mode: 'peer' # 'none', 'peer', 'client_once','fail_if_no_pee smtp_enable_starttls_auto: 'true' # 'false' # If your mail server requires authentication, please change. smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5' -registrant_url: 'https:/registrant.example.com' # for valid email body registrant links +registrant_url: 'https://registrant.example.com' # for valid email body registrant links # Staging env does not send any emails unless they are whitelisted whitelist_emails_for_staging: > test@example.org, From dc90ec519cd25ce542a1fa902c6f6aed2ad1064a Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 3 Nov 2016 18:26:21 +0200 Subject: [PATCH 2/3] Use "registrant_url" from env for all mailers --- config/application.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 2121039dc..dd3a1213e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,7 @@ module Registry # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - config.time_zone = ENV['time_zone'] || 'Tallinn' # NB! It should be defined, + config.time_zone = ENV['time_zone'] || 'Tallinn' # NB! It should be defined, # otherwise ActiveRecord usese other class internally. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. @@ -60,6 +60,10 @@ module Registry g.helper false end + registrant_portal_uri = URI.parse(ENV['registrant_url']) + config.action_mailer.default_url_options = { host: registrant_portal_uri.host, + protocol: registrant_portal_uri.scheme } + config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true From d04f7574a95315947556671eb05207fa2daf79f4 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 3 Nov 2016 18:27:12 +0200 Subject: [PATCH 3/3] Remove mailer config from development env sample --- config/environments/development-example.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/environments/development-example.rb b/config/environments/development-example.rb index ac644a8c9..f2e07435a 100644 --- a/config/environments/development-example.rb +++ b/config/environments/development-example.rb @@ -33,11 +33,6 @@ Rails.application.configure do config.action_view.raise_on_missing_translations = true - config.action_mailer.raise_delivery_errors = false - config.action_mailer.default_url_options = { host: 'localhost:8081' } - config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = { address: 'localhost', port: 1025 } # MailCatcher - # for finding database optimization config.after_initialize do Bullet.enable = true