diff --git a/config/application.rb b/config/application.rb index 1c92888..879cffc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -40,5 +40,11 @@ module TurniereBackend resource '*', headers: :any, methods: :any, expose: ['access-token', 'client', 'expiry', 'uid'] end end + + # Mail + config.action_mailer.default_url_options = { host: 'turnie.re' } + config.action_mailer.default_options = { + from: 'noreply@turnie.re' + } end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 5e8fcca..3255142 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -54,7 +54,10 @@ Rails.application.configure do config.file_watcher = ActiveSupport::EventedFileUpdateChecker # Mail - config.action_mailer.default_url_options = { host: 'localhost' } + config.action_mailer.default_url_options = { host: 'localhost:3000' } config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = { address: 'localhost', port: 1025 } + config.action_mailer.smtp_settings = { + address: 'localhost', + port: 1025 + } end diff --git a/config/environments/production.rb b/config/environments/production.rb index d9fc517..99d3cb3 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -53,10 +53,6 @@ Rails.application.configure do config.action_mailer.perform_caching = false - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true @@ -79,4 +75,13 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Mail + config.action_mailer.raise_delivery_errors = true + config.action_mailer.default_url_options = { host: 'api01.turnie.re' } + config.action_mailer.delivery_method = :mailgun + config.action_mailer.mailgun_settings = { + api_key: Rails.application.credentials.dig(:mailgun, :api_key), + domain: Rails.application.credentials.dig(:mailgun, :domain) + } end diff --git a/config/initializers/devise_token_auth.rb b/config/initializers/devise_token_auth.rb index dec712e..4d3e626 100644 --- a/config/initializers/devise_token_auth.rb +++ b/config/initializers/devise_token_auth.rb @@ -47,4 +47,6 @@ DeviseTokenAuth.setup do |config| # If, however, you wish to integrate with legacy Devise authentication, you can # do so by enabling this flag. NOTE: This feature is highly experimental! # config.enable_standard_devise_support = false + + config.default_confirm_success_url = 'https://frontend01.turnie.re' end