diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-04-19 19:23:42 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-04-19 19:23:42 -0400 |
commit | f190be9e2d4d285fb71d84e5d3884206067cf7af (patch) | |
tree | ca0c4bd21eeb85102731b79eb5dda526655ce82b /app/Controller | |
parent | ac86c3100a1030026024c33c1cf02ec79f08ff51 (diff) |
Add Sendgrid integration (incoming email handling)
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/Webhook.php | 14 |
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'; + } } |