summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Webhook.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/Controller/Webhook.php b/app/Controller/Webhook.php
index 06bfcd4e..667c5087 100644
--- a/app/Controller/Webhook.php
+++ b/app/Controller/Webhook.php
@@ -128,4 +128,18 @@ class Webhook extends Base
echo $this->mailgunWebhook->parsePayload($_POST) ? 'PARSED' : 'IGNORED';
}
+
+ /**
+ * Handle Sendgrid webhooks
+ *
+ * @access public
+ */
+ public function sendgrid()
+ {
+ if ($this->config->get('webhook_token') !== $this->request->getStringParam('token')) {
+ $this->response->text('Not Authorized', 401);
+ }
+
+ echo $this->sendgridWebhook->parsePayload($_POST) ? 'PARSED' : 'IGNORED';
+ }
}