PHP code example of citricguy / postmark-webhooks-laravel
1. Go to this page and download the library: Download citricguy/postmark-webhooks-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
citricguy / postmark-webhooks-laravel example snippets
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
PostmarkWebhookCalled::class => [
ListenerClasses::class, // Create with `php artisan make:listener <listener name>`
],
];
namespace App\Listeners;
use Citricguy\PostmarkWebhooks\Events\PostmarkWebhookReceived;
class ProcessPostmarkWebhooks
{
/**
* Create the event listener.
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle(PostmarkWebhookReceived $event): void
{
// Process Webhook Data Here.
// Access the PostmarkApp payload using: $event->payload.
// The email address, record type and message ID are also made available:
// $event->email;
// $event->recordType;
// $event->messageId;
}
}