Revamp action_mailer config

`registrant_url` setting in `application.yml` is misnamed. In fact,
it has nothing to do with Registrant Portal. The intention is to
provide default URL options for `action_mailer`, therefore
`registrant_url` is removed, and new settings are introduced instead:

- `action_mailer_default_protocol`
- `action_mailer_default_host`
- `action_mailer_default_port`
This commit is contained in:
Artur Beljajev 2019-04-06 19:24:13 +03:00
parent 6fa1ce9128
commit 70cf7f0e75
3 changed files with 9 additions and 4 deletions

View file

@ -21,7 +21,6 @@ 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
#
# ADMIN server
@ -143,12 +142,17 @@ same_site_session_cookies: 'false' # false|strict|lax
release_domains_to_auction: 'true'
auction_api_allowed_ips: '' # 192.0.2.0, 192.0.2.1
action_mailer_default_protocol: # default: http
action_mailer_default_host:
action_mailer_default_port: # default: no port (80)
# Since the keys for staging are absent from the repo, we need to supply them separate for testing.
test:
payments_seb_bank_certificate: 'test/fixtures/files/seb_bank_cert.pem'
payments_seb_seller_private: 'test/fixtures/files/seb_seller_key.pem'
release_domains_to_auction: 'false'
auction_api_allowed_ips: ''
action_mailer_default_host: 'registry.test'
# Airbrake // Errbit:
airbrake_host: "https://your-errbit-host.ee"

View file

@ -69,9 +69,9 @@ module DomainNameRegistry
g.test_framework nil
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.default_url_options = { protocol: ENV['action_mailer_default_protocol'],
host: ENV['action_mailer_default_host'],
port: ENV['action_mailer_default_port'] }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true

View file

@ -11,4 +11,5 @@ Figaro.require_keys(%w[
legal_documents_dir
bank_statement_import_dir
time_zone
action_mailer_default_host
])