Sha256: 3a2f8249b658ed3352cd877e9f55ae2c6a48ddcd7ea64b21d9aa309891376984

Contents?: true

Size: 995 Bytes

Versions: 3

Compression:

Stored size: 995 Bytes

Contents

require 'httparty'
require 'md5'
module Integrity
  class Notifier
    class NotifyioClient
      def self.post(emails, api_key, title, body)
        emails.split(',').each do |email|
          email_hash = MD5.hexdigest(email.strip!)
          HTTParty.post "http://api.notify.io/v1/notify/#{email_hash}?api_key=#{api_key}", :body => {
                                                                                                      :type => 'regular',
                                                                                                      :title => title,
                                                                                                      :body => body,
                                                                                                      :generator => 'integrity-notifyio notifier' 
                                                                                                    }
          
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
integrity-notifyio-0.1.3 lib/integrity/notifier/notifyio_client.rb
integrity-notifyio-0.1.2 lib/integrity/notifier/notifyio_client.rb
integrity-notifyio-0.1.1 lib/integrity/notifier/notifyio_client.rb