iamjpsingh/mautic-ses-plugin
最新稳定版本:1.0.0
Composer 安装命令:
composer require iamjpsingh/mautic-ses-plugin
包简介
Bounce, complaint, and delivery tracking for Amazon SES via SNS webhooks for Mautic 6+
README 文档
README
Amazon SES webhook handler plugin for Mautic 6+. Automatically tracks bounces, complaints, deliveries, and more via AWS SNS webhooks. Marks contacts as Do Not Contact on hard bounces and spam complaints.
Works with Symfony's built-in SES transport (symfony/amazon-mailer) — no custom transport needed.
Credits
This plugin is based on the amazing work by @pm-pmaas and their original etailors/mautic-amazon-ses plugin. Huge thanks to them for building the foundation!
The original plugin supports Mautic 4/5. This version has been rewritten and upgraded for Mautic 6+ with:
- Full support for all 10 SES event types (not just bounce/complaint/delivery)
- SES v1 + v2 payload format support
- Email address parsing fix for SES
"Display Name" <email>format - SNS
UnsubscribeConfirmationhandling - Modern PHP 8.2+ strict typing
- Composer/Packagist ready for easy installation
Requirements
- Mautic 6.x / 7.x+
- PHP 8.2+
symfony/amazon-mailerpackage- AWS account with SES and SNS access
- SES verified domain or email address
Installation
composer require iamjpsingh/mautic-ses-plugin php bin/console cache:clear php bin/console mautic:plugins:reload
That's it! The plugin is ready to use.
Quick Start Guide
Step 1: Create IAM Access Keys
- Go to AWS Console > IAM > Users
- Select or create a user with SES permissions
- Go to Security credentials > Create access key
- Save the Access Key ID and Secret Access Key
Step 2: Configure Mautic Email Settings
Go to Mautic > Settings > Email Settings and configure:
| Field | Value |
|---|---|
| Scheme | ses+api |
| Host | default |
| User | Your AWS Access Key ID |
| Password | Your AWS Secret Access Key |
| Options | Key: region, Value: your AWS region (e.g. us-east-1, ap-south-1) |
Click Save and Send Test Email to verify.
Step 3: Create SNS Topic
- Go to AWS SNS Console > Topics > Create topic
- Select Standard type
- Name it
mautic-ses-notifications - Click Create topic
Step 4: Create SNS Subscription
- Inside the topic, click Create subscription
- Set:
- Protocol: HTTPS
- Endpoint:
https://your-domain.com/mailer/callback
- Click Create subscription
- The plugin auto-confirms the subscription
Step 5: Connect SES to SNS
- Go to SES > Identities > your-domain > Notifications tab
- Click Edit on Feedback notifications
- Set your SNS topic for Bounce, Complaint, and Delivery
- Enable Include original email headers
- Click Save
Step 6: Test It!
- Create a contact in Mautic with email:
bounce@simulator.amazonses.com - Send an email to that contact
- The contact should be marked as Do Not Contact (Bounced)
Alternative Configuration Methods
Via config/local.php
'mailer_dsn' => 'ses+api://ACCESS_KEY:SECRET_KEY@default?region=us-east-1',
Via Environment Variable
MAILER_DSN=ses+api://ACCESS_KEY:SECRET_KEY@default?region=us-east-1
Available DSN Schemes
| Scheme | Protocol | Use case |
|---|---|---|
ses+api |
SES v2 HTTPS API | Recommended - fastest |
ses+https |
SES v2 HTTPS | Alternative API method |
ses+smtp |
SMTP via SES | Use if API access is restricted |
ses |
Default (same as ses+smtp) |
Fallback |
Supported SES Event Types
All 10 SES event types are handled:
| Event Type | Action | Description |
|---|---|---|
| Bounce | Marks contact as Do Not Contact (Bounced) | Hard/soft bounce with full diagnostics |
| Complaint | Marks contact as Do Not Contact (Unsubscribed) | Spam complaint from recipient |
| Delivery | Logged | Successful delivery confirmation |
| Reject | Marks contact as Do Not Contact (Bounced) | SES rejected the email (e.g., virus detected) |
| Send | Logged | SES accepted the email for delivery |
| Open | Logged | Recipient opened the email |
| Click | Logged | Recipient clicked a link |
| DeliveryDelay | Logged as warning | Temporary delay (mailbox full, etc.) |
| Rendering Failure | Logged as error | SES template rendering failed |
| Subscription | Logged | Recipient changed subscription preferences |
SNS Message Types
| Type | Action |
|---|---|
| SubscriptionConfirmation | Auto-confirmed (calls SubscribeURL) |
| UnsubscribeConfirmation | Logged as warning |
| Notification | Unwrapped and processed as SES event |
Supports both SES v1 (notificationType) and SES v2 (eventType) payload formats.
Advanced: Configuration Set (Optional)
For tracking Open, Click, and other v2 events, create a Configuration Set:
- Go to SES > Configuration Sets > Create
- Name it
mautic-tracking - Add an SNS event destination for all event types
- Add
configuration_set=mautic-trackingto your DSN options
Webhook Endpoint
POST /mailer/callback
Accepts:
- SNS SubscriptionConfirmation (auto-confirmed)
- SNS UnsubscribeConfirmation (acknowledged)
- SNS Notification wrapping SES events
- Direct SES event JSON
SES Simulator Addresses (For Testing)
| Address | Simulates |
|---|---|
bounce@simulator.amazonses.com |
Hard bounce |
complaint@simulator.amazonses.com |
Spam complaint |
success@simulator.amazonses.com |
Successful delivery |
suppressionlist@simulator.amazonses.com |
Suppression list bounce |
ooto@simulator.amazonses.com |
Out of office (soft bounce) |
Troubleshooting
"Unsupported scheme ses+api" error
composer require symfony/amazon-mailer
Bounces not being recorded
- Verify SNS subscription is Confirmed in AWS SNS Console
- Check SES Notifications tab - is your SNS topic selected for Bounce/Complaint/Delivery?
- Check webhook URL is publicly accessible
- Check Mautic logs:
var/logs/mautic_*.php
Test email works but campaign emails don't
- Check SES sending limits in AWS Console
- Verify you're out of the SES sandbox (or recipients are verified)
Plugin not showing in Mautic
php bin/console cache:clear php bin/console mautic:plugins:reload
IAM Policy
Minimum required IAM permissions for sending:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ses:SendEmail",
"ses:SendRawEmail",
"ses:GetSendStatistics",
"ses:GetSendQuota"
],
"Resource": "*"
}
]
}
Contributing
Found a bug? Have a suggestion? Please open an issue or submit a pull request.
License
GPL-3.0-or-later
Made with love for the Mautic community. Special thanks to @pm-pmaas for the original etailors/mautic-amazon-ses plugin that made this possible.
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2026-03-31

