3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/last-resort/webhooks.rb', line 3
def self.create_hooks
config = Config.new
contextio = ContextIO::Connection.new(config.contextio_key, config.contextio_secret)
contextio.deleteAllWebhooks config.contextio_account
config.matchers.each do |matcher|
contextio.createWebhook CONFIG.contextio_account,
:callback_url => "http://#{CONFIG.host}/matched_email",
:failure_notif_url => "http://google.ca",
:filter_subject => matcher[:subject].source,
:sync_period => "immediate"
end
end
|