Skip to content

Commit

Permalink
Merge pull request #1151 from internetee/revamp-action-mailer-config
Browse files Browse the repository at this point in the history
Revamp `action_mailer` config
  • Loading branch information
vohmar authored Apr 18, 2019
2 parents b674d12 + 70cf7f0 commit 6a61d7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion config/application-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class Application < Rails::Application
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
Expand Down
1 change: 1 addition & 0 deletions config/initializers/figaro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
legal_documents_dir
bank_statement_import_dir
time_zone
action_mailer_default_host
])

0 comments on commit 6a61d7d

Please sign in to comment.