This notifier ships notifications over the HTTP protocol.
Just add the HTTParty gem to your Gemfile
:
gem 'httparty'
To configure it, you need to set the url
option, like this:
Rails.application.config.middleware.use ExceptionNotification::Rack,
email: {
email_prefix: '[PREFIX] ',
sender_address: %{"notifier" <notifier@example.com>},
exception_recipients: %w{exceptions@example.com}
},
webhook: {
url: 'http://domain.com:5555/hubot/path'
}
By default, the WebhookNotifier will call the URLs using the POST method. But, you can change this using the http_method
option.
Rails.application.config.middleware.use ExceptionNotification::Rack,
email: {
email_prefix: '[PREFIX] ',
sender_address: %{"notifier" <notifier@example.com>},
exception_recipients: %w{exceptions@example.com}
},
webhook: {
url: 'http://domain.com:5555/hubot/path',
http_method: :get
}
Besides the url
and http_method
options, all the other options are passed directly to HTTParty. Thus, if the HTTP server requires authentication, you can include the following options:
Rails.application.config.middleware.use ExceptionNotification::Rack,
email: {
email_prefix: '[PREFIX] ',
sender_address: %{"notifier" <notifier@example.com>},
exception_recipients: %w{exceptions@example.com}
},
webhook: {
url: 'http://domain.com:5555/hubot/path',
basic_auth: {
username: 'alice',
password: 'password'
}
}
For more HTTParty options, check out the documentation.