Class: Twelvefactor::Environment::Mailer::Sendmail

Inherits:
Object
  • Object
show all
Defined in:
lib/twelvefactor/environment/mailer/sendmail.rb

Overview

frozen_string_literal: true

Class Method Summary collapse

Class Method Details

.apply(app, mailer_url) ⇒ Object



5
6
7
8
9
# File 'lib/twelvefactor/environment/mailer/sendmail.rb', line 5

def self.apply app, mailer_url
  config = app.config
  config.action_mailer.delivery_method = :sendmail
  config.action_mailer.sendmail_settings = sendmail_settings mailer_url
end

.sendmail_settings(url) ⇒ Object



11
12
13
14
15
16
# File 'lib/twelvefactor/environment/mailer/sendmail.rb', line 11

def self.sendmail_settings url
  {
    location: url.path,
    arguments: url.query && URI.decode(url.query)
  }.compact
end