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 →
A simple form builder that stays out of your way image

A simple form builder that stays out of your way

Read article
Laravel AI: Trace Agent Runs With Lifecycle Events image

Laravel AI: Trace Agent Runs With Lifecycle Events

Read article
Laravel AI: Get Raw HTTP Responses and Rate Limits image

Laravel AI: Get Raw HTTP Responses and Rate Limits

Read article
Agent Run Observability in Laravel AI SDK 0.11 image

Agent Run Observability in Laravel AI SDK 0.11

Read article
Debounced Queued Event Listeners in Laravel image

Debounced Queued Event Listeners in Laravel

Read article
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