News

Statamic Mailables Viewer Previews Laravel Emails in the Control Panel

Published
Statamic Mailables Viewer Previews Laravel Emails in the Control Panel image

Mailables Viewer is a new free Statamic add-on from Jack McDade that discovers the Laravel mailables in an application and makes them available under Utilities → Mailables in the Control Panel.

If you're anything like me, you've got a bunch of /preview-email/{email} routes sitting in web.php, commented out until you need them. You know the ones. They new up a WelcomeEmail Laravel mailable with a pile of fake data, dump the HTML, and give you a webpage you can hit while you make your changes.

Or maybe you're even lazier and you just send it to yourself. Again. And again. You're afraid Herd Pro or Mailtrap are starting to judge you. Been there too.

Well, I got tired of that and built Mailables Viewer.

The add-on renders each mailable's HTML without requiring dedicated preview routes or configuration. It generates sample constructor data, lets you edit scalar values while watching the preview and envelope update, and provides desktop, tablet, and mobile views. You can also inspect the subject, sender, attachments, template, queue status, and references to the mailable within the codebase.

Mailables Viewer can copy the rendered HTML or send a test with sendNow(), including mailables that normally use a queue. Objects and arrays remain read-only, while strings, numbers, booleans, and dates can be changed in the data editor. Mailables outside the default app/Mail directory can be registered through the add-on's facade.

Super users receive access automatically, and other roles can be granted the access mailables utility permission. Read McDade's announcement for screenshots and the full walkthrough.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
Laravel Tackle: Run an AI Coding Agent in Your Laravel App image

Laravel Tackle: Run an AI Coding Agent in Your Laravel App

Read article
Queue::forward(): Reroute Laravel Queues in One Place image

Queue::forward(): Reroute Laravel Queues in One Place

Read article
Laravel Read-Through Filesystem: Lazy Storage Migration image

Laravel Read-Through Filesystem: Lazy Storage Migration

Read article
Read-Through Disks and Debounced Listeners in Laravel 13.26 image

Read-Through Disks and Debounced Listeners in Laravel 13.26

Read article
Lerd: A Free, Open Source Herd Alternative for Linux and macOS image

Lerd: A Free, Open Source Herd Alternative for Linux and macOS

Read article
Let's Encrypt HTTPS on an IP Address With FrankenPHP image

Let's Encrypt HTTPS on an IP Address With FrankenPHP

Read article