xammie/mailbook
Mailbook is a Laravel dev package for previewing and inspecting mailables and email notifications without triggering them in your app. Register mails via a routes file (with DI or closures) and view them at /mailbook.
Developer Experience (DX) & Tooling:
Cost Efficiency:
Scalability:
Compliance & Risk Mitigation:
mail:fake test may suffice./mailbook route is restricted in production (it’s intended for dev/staging).mail:fake), Mailbook may add redundancy."Mailbook is a developer tool that eliminates guesswork in email testing—saving time, reducing bugs, and improving user experience.
composer require xammie/mailbook). No ongoing costs.Ask: Let’s pilot Mailbook for our next high-priority email feature (e.g., [Feature X]) and measure the time saved in QA."
"Mailbook replaces ‘send a test email to my Gmail’ with a structured, repeatable workflow for email testing in Laravel.
Why It’s Better Than the Status Quo:
| Current Pain Points | Mailbook Fixes It |
|---|---|
| Debugging emails via logs/screenshots | Real-time preview with device emulation. |
| Localization testing is manual | Switch between languages with a dropdown. |
| Database-dependent emails break tests | Automatic rollback after preview. |
| Ad-hoc email testing (e.g., Slack) | Centralized, version-controlled registry. |
| Missing attachments/inline images | Visual inspection in the UI. |
Key Features for Your Workflow:
routes/mailbook.php (supports closures, DI, and variants).
Mailbook::add(WelcomeNotification::class)
->variant('VIP', fn () => new WelcomeNotification($vipUser));
php artisan mailbook:test (hypothetical future feature).Getting Started:
composer require --dev xammie/mailbookphp artisan mailbook:install (creates routes/mailbook.php)./mailbook in your browser.Trade-offs:
Next Steps:
"Mailbook lets you see exactly how your emails will look before they go live—no coding required.
What You’ll Love:
How It Works:
/mailbook in your browser.Example Use Case:
Ask: ‘Can we use Mailbook to preview the [Campaign Z] emails before we send them to users?’"
How can I help you explore Laravel packages today?