Stop Hacking Together Email Preview Routes
If you have ever littered web.php with commented-out /preview-email/{email} routes, or sent the same test message to yourself a dozen times just to check a layout tweak, you are not alone. Jack McDade built Mailables Viewer to replace exactly that workflow.
Mailables Viewer is a free Statamic add-on that scans your Laravel application for mailable classes and surfaces them under Utilities → Mailables in the Statamic Control Panel. No extra configuration, no dedicated routes, no fake-data bootstrapping scripts scattered across the codebase.
How It Works
Once installed, the add-on:
- Auto-discovers every mailable in
app/Mail(and any additional directories you register via the facade). - Generates sample constructor data so each mailable can be instantiated and rendered immediately.
- Renders the HTML preview inline, with desktop, tablet, and mobile viewport toggles.
The live data editor lets you modify scalar constructor values — strings, numbers, booleans, and dates — and watch the preview and envelope update in real time. Objects and arrays are displayed read-only to keep things safe.
Inspecting the Envelope
Beyond the rendered HTML, Mailables Viewer exposes the full envelope for each mailable:
- Subject line
- Sender address
- Attachments
- Blade/Markdown template reference
- Queue status
- References to the mailable class within the codebase
This makes it straightforward to audit email configuration without ever leaving the Control Panel.
Sending Test Emails
When you need to verify rendering in a real inbox, the add-on can copy the rendered HTML to the clipboard or dispatch the mailable immediately via sendNow(). Notably, this works even for mailables that are normally queued, so you can test the full email without waiting for a worker.
// Mailables outside app/Mail can be registered like this:
use Statamic\Addons\MailablesViewer\Facades\MailablesViewer;
MailablesViewer::discover('App\\Notifications\\Mail');
Permissions
Access is straightforward:
- Super users get access automatically.
- Other roles can be granted the
access mailables utilitypermission through the standard Statamic roles and permissions UI.
Why This Matters for Laravel Developers
Email previewing has always been a friction point in Laravel development. The typical workarounds — preview routes, repeated test sends to Mailtrap or Herd Pro, or browser-sync hacks — all require manual setup and tear-down. Mailables Viewer centralises this entirely inside the CMS UI, which is especially valuable on projects where non-developers (content editors, QA testers) need to verify email copy without touching the codebase.
Key Takeaways
- Free Statamic add-on that auto-discovers and previews all Laravel mailables in the Control Panel.
- Live data editor for scalar constructor values with real-time preview updates.
- Inspect subject, sender, attachments, template, queue status, and codebase references.
- Send test emails immediately with
sendNow(), even for queued mailables. - Desktop, tablet, and mobile viewport previews built in.
- Mailables outside
app/Mailcan be registered via the add-on's facade. - Role-based access control using Statamic's standard permissions system.
Source: Laravel News — Statamic Mailables Viewer Previews Laravel Emails in the Control Panel