Chatwoot/lib/webhooks/trigger.rb
Sojan Jose 8daf1fe033
chore: Add down gem for Local file downloads (#2765)
- Add down gem to handle downloading files to host machine
- Remove the LocalResource class
- Introduce max limit for contact avatars send via SDK
2021-08-11 16:40:28 +05:30

14 lines
431 B
Ruby

class Webhooks::Trigger
def self.execute(url, payload)
RestClient::Request.execute(
method: :post,
url: url, payload: payload.to_json,
headers: { content_type: :json, accept: :json },
timeout: 5
)
rescue *ExceptionList::REST_CLIENT_EXCEPTIONS => e
Rails.logger.info "Exception: invalid webhook url #{url} : #{e.message}"
rescue StandardError => e
Sentry.capture_exception(e)
end
end