module Canari::Notifier

Send email notifications.

Public Class Methods

notify(matching, payload) click to toggle source
# File lib/canari/notifier.rb, line 9
def notify(matching, payload)
  Mail.new do
    from Canari.config[:notifier][:from]
    to Canari.config[:notifier][:to]
    subject 'New match in the Certificate Transparency Log network'
    body 'A new certificate has been emitted matching: ' \
         "#{matching.join(', ')}. See the attached file for details."
    add_file filename: 'certificate.json',
             content: JSON.pretty_generate(payload)
  end.deliver
end