summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-04-19 14:48:12 -0400
committerFrederic Guillot <fred@kanboard.net>2015-04-19 14:48:12 -0400
commit1891e87d035c235550b5889da585e166cf49502f (patch)
treea6100a70184e635788aaed4071ca968a0fde3088 /app/Controller
parent370b5a0fd7c1dba60e3b973506ba087adba42be0 (diff)
Add Postmark integration (inbound emails for task creation)
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Webhook.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Controller/Webhook.php b/app/Controller/Webhook.php
index ef79379f..afa0543a 100644
--- a/app/Controller/Webhook.php
+++ b/app/Controller/Webhook.php
@@ -100,4 +100,20 @@ class Webhook extends Base
echo $result ? 'PARSED' : 'IGNORED';
}
+
+ /**
+ * Handle Postmark webhooks
+ *
+ * @access public
+ */
+ public function postmark()
+ {
+ if ($this->config->get('webhook_token') !== $this->request->getStringParam('token')) {
+ $this->response->text('Not Authorized', 401);
+ }
+
+ $result = $this->postmarkWebhook->parsePayload($this->request->getJson() ?: array());
+
+ echo $result ? 'PARSED' : 'IGNORED';
+ }
}