summaryrefslogtreecommitdiff
path: root/app/Integration/PostmarkWebhook.php
diff options
context:
space:
mode:
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