This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ |