From 772b8378beb478a89e638f0bda45cd01ba7cbbab Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 24 Oct 2015 15:47:18 -0400 Subject: [PATCH] Webhook is receiving data from post variables --- Controller/Webhook.php | 2 +- EmailHandler.php | 6 +++--- README.md | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Controller/Webhook.php b/Controller/Webhook.php index 39b98fe..bf7a56c 100644 --- a/Controller/Webhook.php +++ b/Controller/Webhook.php @@ -23,6 +23,6 @@ public function receiver() $this->checkWebhookToken(); $handler = new EmailHandler($this->container); - echo $handler->receiveEmail($this->request->getJson()) ? 'PARSED' : 'IGNORED'; + echo $handler->receiveEmail($_POST) ? 'PARSED' : 'IGNORED'; } } diff --git a/EmailHandler.php b/EmailHandler.php index 7ffa9f2..53f5e3f 100644 --- a/EmailHandler.php +++ b/EmailHandler.php @@ -63,7 +63,7 @@ public function receiveEmail(array $payload) $user = $this->user->getByEmail($envelope['from']); if (empty($user)) { - $this->container['logger']->debug('SendgridWebhook: ignored => user not found'); + $this->logger->debug('SendgridWebhook: ignored => user not found'); return false; } @@ -71,13 +71,13 @@ public function receiveEmail(array $payload) $project = $this->project->getByIdentifier(Tool::getMailboxHash($sender)); if (empty($project)) { - $this->container['logger']->debug('SendgridWebhook: ignored => project not found'); + $this->logger->debug('SendgridWebhook: ignored => project not found'); return false; } // The user must be member of the project if (! $this->projectPermission->isMember($project['id'], $user['id'])) { - $this->container['logger']->debug('SendgridWebhook: ignored => user is not member of the project'); + $this->logger->debug('SendgridWebhook: ignored => user is not member of the project'); return false; } diff --git a/README.md b/README.md index a5da246..fa32702 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,10 @@ The Kanboard webhook url is displayed in **Settings > Integrations > Sendgrid** 1. Be sure that your users have an email address in their profiles 2. Assign a project identifier to the desired projects: **Project settings > Edit** 3. Try to send an email to your project: something+myproject@mydomain.tld + +The sender must have the same email address in Kanboard and must be member of the project. + +Troubleshooting +--------------- + +- Enable debug mode and check logs