topoff / laravel-mail-manager
Manages mail templates and mail sending in Laravel
Requires
- php: ^8.3
- aws/aws-sdk-php: ^3.344
- illuminate/contracts: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/boost: ^2.1
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- rector/rector: ^2.3
- spatie/laravel-ray: ^1.35
- dev-master
- v4.4.0
- v4.3.3
- v4.3.2
- v4.3.1
- v4.3.0
- v4.2.2
- v4.2.1
- v4.2.0
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.0
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.0
- v2.0.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
This package is auto-updated.
Last update: 2026-03-03 20:54:04 UTC
README
This package provides a comprehensive solution for managing mail templates and mail sending in Laravel applications.
Installation
You can install the package via composer:
composer require topoff/laravel-mail-manager
You can publish the config file with:
php artisan vendor:publish --tag="mail-manager-config"
Usage
Documentation coming soon.
SES/SNS Auto Setup (SES v2 Configuration Sets)
The package can provision SES/SNS tracking resources via AWS API:
- SES Configuration Set
- SES Event Destination (SNS)
- SNS Topic policy for SES publish
- SNS HTTPS subscription to
mail-manager.tracking.sns
Enable it in config:
'ses_sns' => [ 'enabled' => true, ],
Then run:
php artisan mail-manager:ses-sns:setup-tracking php artisan mail-manager:ses-sns:check-tracking php artisan mail-manager:ses-sns:setup-sending php artisan mail-manager:ses-sns:check-sending php artisan mail-manager:ses-sns:teardown --force
In Nova (Message Types resource), use action Setup SES/SNS Tracking to run setup and open the status/check page.
BCC Recipient Filtering
When BCC is added to an email (e.g. via AddBccToEmailsListener), both the TO and BCC recipients share the same SES message ID. SNS event notifications (delivery, bounce, complaint) are matched to Message records by tracking_message_id, so without filtering, events for the BCC recipient would corrupt the original recipient's tracking data (e.g. a BCC bounce setting success: false on the original message).
The SNS event jobs (RecordDeliveryJob, RecordBounceJob, RecordComplaintJob) guard against this by comparing the event's recipient email(s) against the message's tracking_recipient_email. If they don't match, the event is skipped for that message. This comparison is case-insensitive and null-safe — messages without a tracking_recipient_email process all events as before.
RecordRejectJob is unaffected since reject notifications carry no per-recipient data.
Nova Integration
If Laravel Nova is installed, the package can auto-register a tracked messages resource with preview and resend actions.
Configuration keys:
mail-manager.tracking.nova.enabledmail-manager.tracking.nova.register_resourcemail-manager.tracking.nova.resourcemail-manager.tracking.nova.preview_route
The preview action uses a temporary signed URL and the package route mail-manager.tracking.nova.preview.
Development
Code Quality Tools
This package uses several tools to maintain code quality:
Laravel Pint (Code Formatting)
Format code according to Laravel standards:
composer format
Rector (Automated Refactoring)
Preview potential code improvements:
composer rector-dry
Apply automated refactorings:
composer rector
PHPStan (Static Analysis)
Run static analysis:
composer analyse
Run All Quality Checks
composer lint
This runs both Pint and PHPStan.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.