From e22da9d32addefa8d739171febcf6f6d0c06ba7b Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 7 Jun 2015 22:17:50 -0400 Subject: Add Mailgun API as mail transport --- app/Integration/MailgunWebhook.php | 71 -------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 app/Integration/MailgunWebhook.php (limited to 'app/Integration/MailgunWebhook.php') diff --git a/app/Integration/MailgunWebhook.php b/app/Integration/MailgunWebhook.php deleted file mode 100644 index 50d96a4a..00000000 --- a/app/Integration/MailgunWebhook.php +++ /dev/null @@ -1,71 +0,0 @@ -user->getByEmail($payload['sender']); - - if (empty($user)) { - $this->container['logger']->debug('MailgunWebhook: ignored => user not found'); - return false; - } - - // The project must have a short name - $project = $this->project->getByIdentifier(Tool::getMailboxHash($payload['recipient'])); - - if (empty($project)) { - $this->container['logger']->debug('MailgunWebhook: 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('MailgunWebhook: ignored => user is not member of the project'); - return false; - } - - // Get the Markdown contents - if (! empty($payload['stripped-html'])) { - $markdown = new HTML_To_Markdown($payload['stripped-html'], array('strip_tags' => true)); - $description = $markdown->output(); - } - else if (! empty($payload['stripped-text'])) { - $description = $payload['stripped-text']; - } - else { - $description = ''; - } - - // Finally, we create the task - return (bool) $this->taskCreation->create(array( - 'project_id' => $project['id'], - 'title' => $payload['subject'], - 'description' => $description, - 'creator_id' => $user['id'], - )); - } -} -- cgit v1.2.3