Skip to content

Instantly share code, notes, and snippets.

View rajeshshettysrs's full-sized avatar

SRSRNSSRS rajeshshettysrs

  • RSL
  • bangalore
View GitHub Profile
@rajeshshettysrs
rajeshshettysrs / sentry_google_chat_webhook.php
Created November 14, 2022 14:25 — forked from Benjaminhu/sentry_google_chat_webhook.php
This script can act as a middleman between Sentry's webhook system and Google Chat Incoming Webhooks
<?php
$googleChatWebhookURL = '<YOUR-GOOGLE-CHAT-WEBHOOK-URL>';
$integrationClientSecret = '<YOUR-Sentry-Settings-integration-Edit Integration-CREDENTIALS-Client Secret>';
/**
* https://developers.google.com/chat/how-tos/webhooks#step_2_write_the_webhook_script
* https://developers.google.com/chat/api/guides/message-formats/basic
*/
@rajeshshettysrs
rajeshshettysrs / sentry_mattermost_webhook.php
Created November 11, 2022 10:11 — forked from dkmonaghan/sentry_mattermost_webhook.php
This script can act as a middleman between Sentry's webhook system and Mattermost's Incoming Webhooks
<?php
$json = json_decode(file_get_contents('php://input'), true);
if ($json['action'] !== 'created'){ die('Only create actions are alerted'); }
$error = $json['data']['issue'];
if ($error['project']['id'] == 1){ die('Ignore internal errors.'); }
if (empty($error['shortId'])){ die('No shortId passed'); }
// Set channel and username