From 6a1617348edc93d1313973f0341f672b17424bc7 Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:44:18 -0300 Subject: [PATCH] [WIP] Ticket CV2-5067: Use Mailcatcher to send emails (fix) --- config/config.yml.example | 2 +- config/environments/development.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.yml.example b/config/config.yml.example index 692952d71..44749ca97 100644 --- a/config/config.yml.example +++ b/config/config.yml.example @@ -160,7 +160,7 @@ development: &default smtp_user: # '' smtp_pass: # '' smtp_default_url_host: 'http://localhost:3333' # Used to construct URLs for links in email - smtp_use_mailcatcher: false + smtp_mailcatcher_host: # 'host.docker.internal' # Pusher notification service https://pusher.com/channels # diff --git a/config/environments/development.rb b/config/environments/development.rb index 6e46ac0bc..3f54f6587 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -84,9 +84,10 @@ puts '[WARNING] config.hosts not provided. Only requests from localhost are allowed. To change, update `whitelisted_hosts` in config.yml' end - if ENV['smtp_use_mailcatcher'] || cfg['smtp_use_mailcatcher'] + mailcatcher_host = ENV['smtp_mailcatcher_host'] || cfg['smtp_mailcatcher_host'] + unless mailcatcher_host.blank? config.action_mailer.smtp_settings = { - address: '127.0.0.1', + address: mailcatcher_host, port: 1025 } end