2022-01-26 11:33:12 +01:00
|
|
|
if ENV.fetch('MAILTRAP_ENABLED') == 'enabled'
|
|
|
|
ActiveSupport.on_load(:action_mailer) do
|
|
|
|
module Mailtrap
|
|
|
|
class SMTP < ::Mail::SMTP; end
|
|
|
|
end
|
|
|
|
|
|
|
|
ActionMailer::Base.add_delivery_method :mailtrap, Mailtrap::SMTP
|
|
|
|
ActionMailer::Base.mailtrap_settings = {
|
|
|
|
user_name: Rails.application.secrets.mailtrap[:username],
|
|
|
|
password: Rails.application.secrets.mailtrap[:password],
|
2024-03-28 14:34:47 +01:00
|
|
|
address: 'sandbox.smtp.mailtrap.io',
|
|
|
|
domain: 'sandbox.smtp.mailtrap.io',
|
2022-01-26 11:33:12 +01:00
|
|
|
port: '2525',
|
2024-03-28 14:34:47 +01:00
|
|
|
authentication: :login
|
2022-01-26 11:33:12 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|