Skip to content

Commit

Permalink
[WIP] Ticket CV2-5067: Use Mailcatcher to send emails (fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Aug 20, 2024
1 parent 5c1fdcb commit 6a16173
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ development: &default
smtp_user: # '<GMAIL USERNAME>'
smtp_pass: # '<GMAIL PASSWORD>'
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
#
Expand Down
5 changes: 3 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a16173

Please sign in to comment.