Sha256: 55d2c674e95c64c1fa5d88644a684ede60029247fb8f66dffb8f9e42479ba3b0

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

require 'mail'

module Canari
  # Send email notifications.
  module Notifier
    class << self
      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
canari-0.2.0 lib/canari/notifier.rb