Module: Workarea::Configuration::ActionMailer

Extended by:
ActionMailer
Included in:
ActionMailer
Defined in:
lib/workarea/configuration/action_mailer.rb

Instance Method Summary collapse

Instance Method Details

#loadObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/workarea/configuration/action_mailer.rb', line 6

def load
  Rails.application.config.action_mailer.asset_host = Rails.application.config.action_controller.asset_host
  Rails.application.config.action_mailer.show_previews = !Rails.env.production?

  unless Rails.env.test? || Rails.env.development?
    if Rails.application.secrets.smtp_settings.present?
      Rails.application.config.action_mailer.raise_delivery_errors = true
      Rails.application.config.action_mailer.delivery_method = :smtp
      Rails.application.config.action_mailer.smtp_settings = smtp_settings
    end
  end
end

#smtp_settingsObject



19
20
21
# File 'lib/workarea/configuration/action_mailer.rb', line 19

def smtp_settings
  Rails.application.secrets.smtp_settings.merge(enable_starttls_auto: false).symbolize_keys
end