summaryrefslogtreecommitdiff
path: root/app/Integration/PostmarkWebhook.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-04-19 19:23:42 -0400
committerFrederic Guillot <fred@kanboard.net>2015-04-19 19:23:42 -0400
commitf190be9e2d4d285fb71d84e5d3884206067cf7af (patch)
treeca0c4bd21eeb85102731b79eb5dda526655ce82b /app/Integration/PostmarkWebhook.php
parentac86c3100a1030026024c33c1cf02ec79f08ff51 (diff)
Add Sendgrid integration (incoming email handling)
Diffstat (limited to 'app/Integration/PostmarkWebhook.php')
-rw-r--r--app/Integration/PostmarkWebhook.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/Integration/PostmarkWebhook.php b/app/Integration/PostmarkWebhook.php
index 6387ba20..642955df 100644
--- a/app/Integration/PostmarkWebhook.php
+++ b/app/Integration/PostmarkWebhook.php
@@ -21,7 +21,7 @@ class PostmarkWebhook extends Base
*/
public function parsePayload(array $payload)
{
- if (empty($payload['From']) || empty($payload['Subject']) || empty($payload['MailboxHash']) || empty($payload['TextBody'])) {
+ if (empty($payload['From']) || empty($payload['Subject']) || empty($payload['MailboxHash'])) {
return false;
}
@@ -48,12 +48,15 @@ class PostmarkWebhook extends Base
}
// Get the Markdown contents
- if (empty($payload['HtmlBody'])) {
+ if (! empty($payload['HtmlBody'])) {
+ $markdown = new HTML_To_Markdown($payload['HtmlBody'], array('strip_tags' => true));
+ $description = $markdown->output();
+ }
+ else if (! empty($payload['TextBody'])) {
$description = $payload['TextBody'];
}
else {
- $markdown = new HTML_To_Markdown($payload['HtmlBody'], array('strip_tags' => true));
- $description = $markdown->output();
+ $description = '';
}
// Finally, we create the task