Skip to content

Commit

Permalink
Updating Webhook Processing
Browse files Browse the repository at this point in the history
  • Loading branch information
williamrenfrew committed Sep 27, 2017
1 parent 4939aaf commit 2493fd1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,20 @@ You can call the send() function to send an email.

## Webhooks

You can configure a Webhook receiving URL witihn Postal. It should be routed to:
You can configure a Webhook receiving URL within Postal. You need to create a controller within your FuelPHP project that calls:

```php
\Synergitech\Postal\Webhook::ProcessWebhook();
```
https://yourapp.io/synergitech/postal/webhook/appmail

Example Controller file (be sure to allow unauthenticated requests to pass to this function):

```php
class Controller_Webhook extends \Controller_Rest
{
public function action_postal()
{
\Synergitech\Postal\Webhook::ProcessWebhook();
}
}
```
12 changes: 0 additions & 12 deletions classes/controller/webhook.php

This file was deleted.

2 changes: 1 addition & 1 deletion classes/webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function ProcessWebhook()
$response->send(true);
} else {
\Log::warning("No Payload sent from Postal");
$response = new \Response('No payload', 498);
$response = new \Response('No payload', 400);
$response->send(true);
exit;
}
Expand Down

0 comments on commit 2493fd1

Please sign in to comment.