Add Mailgun integration (incoming emails)

This commit is contained in:
Frederic Guillot
2015-04-19 16:01:41 -04:00
parent 392133d9ba
commit ac86c3100a
27 changed files with 255 additions and 3 deletions

View File

@@ -112,8 +112,20 @@ class Webhook extends Base
$this->response->text('Not Authorized', 401);
}
$result = $this->postmarkWebhook->parsePayload($this->request->getJson() ?: array());
echo $this->postmarkWebhook->parsePayload($this->request->getJson() ?: array()) ? 'PARSED' : 'IGNORED';
}
echo $result ? 'PARSED' : 'IGNORED';
/**
* Handle Mailgun webhooks
*
* @access public
*/
public function mailgun()
{
if ($this->config->get('webhook_token') !== $this->request->getStringParam('token')) {
$this->response->text('Not Authorized', 401);
}
echo $this->mailgunWebhook->parsePayload($_POST) ? 'PARSED' : 'IGNORED';
}
}