Module: Mack::Notifier::DeliveryHandlers::Smtp

Defined in:
lib/mack-notifier/delivery_handlers/smtp.rb

Overview

Delivers Mack::Notifier objects using Net::SMTP.

Class Method Summary collapse

Class Method Details

.deliver(mail) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/mack-notifier/delivery_handlers/smtp.rb', line 8

def self.deliver(mail)
  smtp_settings = configatron.mack.notifier.smtp
  Net::SMTP.start(smtp_settings.address, smtp_settings.port, 
                  smtp_settings.domain, smtp_settings.retrieve(:user_name, nil), 
                  smtp_settings.retrieve(:password, nil), smtp_settings.retrieve(:authentication, nil)) do |smtp|
    smtp.sendmail(mail.deliverable, mail.reply_to, mail.recipients)
  end
end