定制 dignac3/mautic-mailgun-callback-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dignac3/mautic-mailgun-callback-bundle

最新稳定版本:1.0.0

Composer 安装命令:

composer require dignac3/mautic-mailgun-callback-bundle

包简介

Mailgun callback handler for Mautic 7: processes bounces, spam complaints and unsubscribes into Mautic DNC.

README 文档

README

Mailgun callback handler plugin tested on Mautic 7.

Processes Mailgun webhook events (bounces, spam complaints, unsubscribes) and updates Mautic DNC (Do Not Contact) lists automatically.

Installation

Copy the plugin folder to your Mautic plugins/ directory:

cp -r MauticMailgunCallbackBundle /path/to/mautic/plugins/

Then clear the Mautic cache:

php bin/console cache:clear
php bin/console mautic:plugins:reload

Configuration

1. Webhook signing key

Set the environment variable:

MAILGUN_WEBHOOK_SIGNING_KEY=your-signing-key

Where to find it: Mailgun → SendingWebhooksHTTP webhook signing key
This key is different from the API key used for sending.

The plugin reads this via Mautic's configuration system. You can also set it via the Mautic admin UI under Configuration → Email Settings (the parameter name is mailgun_webhook_signing_key).

2. Configure the webhook in Mailgun

In Mailgun → SendingWebhooks, add a webhook for your domain pointing to:

https://your-mautic.example.com/mailer/callback

Enable the following event types:

  • Permanent failure (failed)
  • Temporary failure (failed)
  • Spam complaints (complained)
  • Unsubscribes (unsubscribed)

3. Sending configuration (no plugin required)

Sending via Mailgun uses native Mautic/Symfony support. Just set your DSN:

# API (recommended — fastest) but need the symfony/mailgun-mailer package installed
MAUTIC_MAILER_DSN=mailgun+api://SENDING_KEY:DOMAIN@default?region=eu

# HTTP
MAUTIC_MAILER_DSN=mailgun+https://SENDING_KEY:DOMAIN@default?region=eu

# SMTP
MAUTIC_MAILER_DSN=mailgun+smtp://SMTP_LOGIN:SMTP_PASSWORD@default?region=eu

Note: SENDING_KEY and MAILGUN_WEBHOOK_SIGNING_KEY are two different keys.

How it works

Mautic core exposes a public endpoint POST /mailer/callback that dispatches a mautic.email.on_transport_webhook event. This plugin listens to that event, validates the Mailgun HMAC-SHA256 signature, parses the payload, and calls TransportCallback::addFailureByAddress() or addFailureByHashId() to add the contact to Mautic's DNC list.

Mailgun → POST /mailer/callback
           ↓
    [Signature validation]
           ↓
    [Event routing]
    ┌──────────────────────────────┐
    │ failed/permanent → DNC BOUNCED      │
    │ complained       → DNC UNSUBSCRIBED │
    │ unsubscribed     → DNC UNSUBSCRIBED │
    │ others           → ignored          │
    └──────────────────────────────┘
           ↓
    TransportCallback → Mautic DNC

Running tests

bin/phpunit plugins/MauticMailgunCallbackBundle/Tests --testdox

License

GPL 3.0

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固