Class: AppMail::Rails::ActionMailerDeliveryMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/app_mail/rails/action_mailer_delivery_method.rb

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ ActionMailerDeliveryMethod

Returns a new instance of ActionMailerDeliveryMethod.



5
6
7
# File 'lib/app_mail/rails/action_mailer_delivery_method.rb', line 5

def initialize(settings)
  @settings = settings
end

Instance Method Details

#deliver!(message) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/app_mail/rails/action_mailer_delivery_method.rb', line 13

def deliver!(message)
  client.send_raw_message do |m|
    m.mail_from(message.from.first)
    [message.to, message.cc, message.bcc].flatten.compact.uniq.each do |address|
      m.rcpt_to(address)
    end
    m.data(message.to_s)
  end
end

#settingsObject



9
10
11
# File 'lib/app_mail/rails/action_mailer_delivery_method.rb', line 9

def settings
  @settings
end