erwane / whep-mailjet
Mailjet (Sinch) webhooks handler
2.2.0
2025-08-12 21:55 UTC
Requires
- php: ^8.1
- erwane/whep-client: ^2.2
Requires (Dev)
- cakephp/cakephp-codesniffer: ^5.0
- erwane/phpunit-resource-helper: ^2.0
- phpunit/phpunit: ^10.5
- symfony/var-dumper: ^v6.0
README
Webhook handler for Mailjet (Sinch) emailing provider.
Usage
composer require erwane/whep-mailjet
use WHEP\Exception\SecurityException; use WHEP\Exception\WHEPException; use WHEP\Factory; try { $provider = Factory::provider('mailjet', [ 'client_ip' => $_SERVER['REMOTE_ADDR'] ?? null, // Use method from your framework to get the ServerRequest client ip. 'callbacks' => [ ProviderInterface::EVENT_BLOCKED => [$this, 'callbackInvalidate'], ProviderInterface::EVENT_BOUNCE_QUOTA => [$this, 'callbackUnsub'], ], ]); // process the data. $provider->process($webhookData); // Data available from provider getters. $recipient = $provider->getRecipient(); // Launch callbacks $provider->callback(); } catch (SecurityException $e) { // log ? } catch (WHEPException $e) { // log ? }
See WHEP Client README for options, events and getters.