Download the PHP package tvalimaa/mautic-bounce-webhook-bundle without Composer
On this page you can find all versions of the php package tvalimaa/mautic-bounce-webhook-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mautic-bounce-webhook-bundle
Mautic Bounce Webhook Bundle
An unofficial Mautic plugin that processes mailer transport webhook callbacks for bounce and spam events, automatically adding contacts to the Do Not Contact (DNC) list.
Supports Mailjet, SendGrid, and Mailgun out of the box. Adding new providers requires only implementing a single interface.
How it works
- Your mailer sends a webhook POST to Mautic's transport callback endpoint.
- The bundle selects the correct provider based on the
MAILER_BOUNCE_PROVIDERenv var. - The provider fingerprints the payload to confirm it matches the expected format.
- Bounce, spam, and unsubscribe events are recorded via Mautic's
TransportCallback, which marks the contact as DNC.
Hard bounces and permanent failures add contacts with DoNotContact::BOUNCED. Spam complaints and unsubscribes use DoNotContact::UNSUBSCRIBED. Soft bounces are logged and skipped.
Requirements
- Mautic 5, 6, or 7
- PHP 8.1 or higher
Installation
Copy or clone the bundle into your Mautic plugins/ directory:
Then clear the Mautic cache and reload the plugins:
Configuration
Set the following environment variables (e.g. in .env.local):
| Variable | Required | Description |
|---|---|---|
MAILER_BOUNCE_PROVIDER |
Yes | Active provider: mailjet, sendgrid, or mailgun |
MAILER_CALLBACK_SECRET |
No | Secret token appended as ?token= to the webhook URL. When unset the endpoint is unrestricted (useful for local dev). |
Example
Webhook URL
Configure your mailer to POST events to:
Supported providers
Mailjet
Handles bounce (hard only), blocked, and spam events from the Mailjet Event API.
SendGrid
Handles bounce (hard only), spamreport, unsubscribe, and group_unsubscribe events from the SendGrid Event Webhook.
Mailgun
Handles failed (permanent only), complained, and unsubscribed events from the Mailgun Webhook API v3.
Adding a custom provider
- Create a class implementing
BounceProviderInterfacein theProvider/directory. - Add it as a constructor argument in
BounceProviderRegistry. - Register it with a key in
$this->providers. - Set
MAILER_BOUNCE_PROVIDERto the new key.
License
GPL-3.0-only