Chatwoot/lib/webhooks/trigger.rb
2020-08-25 23:04:02 +05:30

9 lines
301 B
Ruby

class Webhooks::Trigger
def self.execute(url, payload)
RestClient.post(url, payload.to_json, { content_type: :json, accept: :json })
rescue RestClient::NotFound => e
Rails.logger.info "invalid url #{url} : #{e.message}"
rescue StandardError => e
Raven.capture_exception(e)
end
end