Module: MultiSMTP::Notifiers::Airbrake

Defined in:
lib/multi_smtp/notifiers/airbrake.rb

Class Method Summary collapse

Class Method Details

.extract_mail_params(mail) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/multi_smtp/notifiers/airbrake.rb', line 11

def self.extract_mail_params(mail)
  {
    delivery_handler: mail.delivery_handler.to_s,
    from: mail.from,
    subject: mail.subject,
    to: mail.to
  }
end

.notify(exception, mail) ⇒ Object



4
5
6
7
8
9
# File 'lib/multi_smtp/notifiers/airbrake.rb', line 4

def self.notify(exception, mail)
  ::Airbrake.notify(exception,
    error_message: "Email delivery failed with all SMTP providers.",
    parameters: { mail: extract_mail_params(mail) }
  )
end