summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
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';
+ }
}