chore(smtp): add mailcatcher configuration
This commit is contained in:
parent
cf1f92409c
commit
31996c7d09
3 changed files with 22 additions and 2 deletions
13
config/initializers/mailcatcher.rb
Normal file
13
config/initializers/mailcatcher.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
if ENV.fetch('MAILCATCHER_ENABLED') == 'enabled'
|
||||
ActiveSupport.on_load(:action_mailer) do
|
||||
module Mailcatcher
|
||||
class SMTP < ::Mail::SMTP; end
|
||||
end
|
||||
|
||||
ActionMailer::Base.add_delivery_method :mailcatcher, Mailcatcher::SMTP
|
||||
ActionMailer::Base.mailcatcher_settings = {
|
||||
address: ENV.fetch("MAILCATCHER_HOST"),
|
||||
port: ENV.fetch("MAILCATCHER_PORT")
|
||||
}
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue