Class: Remind::Service::Notifier

Inherits:
Object
  • Object
show all
Extended by:
Helper::ErrorHandler
Defined in:
lib/remind/services/notifier.rb

Class Method Summary collapse

Methods included from Helper::ErrorHandler

handle_errors

Methods included from Helper::LogHandler

clear_log, #create_log

Class Method Details

.notify(message) ⇒ Object

Send message to slack



14
15
16
17
18
19
20
# File 'lib/remind/services/notifier.rb', line 14

def self.notify(message)
  handle_errors do
    payload = { "text": message }.to_json
    uri = URI(ENV['SLACK_WEBHOOK_URL'])
    Net::HTTP.post(uri, payload, 'Content-Type' => 'application/json')
  end
end