New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

statamic/mailables-viewer

Preview Laravel mailables from the Statamic Control Panel.
2,559 11

Larablocks Analysis

statamic/mailables-viewer works with Laravel 12 and 13 (latest release v1.1.0, Sep 18, 2026).

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 2 of 4 checks; below the bar for Recommended on use.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Sep 18, 2026)
  • 1,140 downloads a month (needs 10,000)
  • 11 GitHub stars (needs 100)

State

Actively maintained
  • Last stable release: Sep 18, 2026.
  • 3 releases in the last 12 months.
  • First released: Aug 20, 2026.
  • Monthly downloads: 1,140.
  • 4 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 26, 2026.

Install
composer require statamic/mailables-viewer
Latest Version:v1.1.0
PHP:^8.2
Laravel:12 · 13
License:MIT
Last Updated:Nov 26, 2026
Links: GitHub  ·  Packagist
Maintainer: jackmcdade

Mailables Viewer

Preview Laravel mailables from the Statamic Control Panel.

Mailables Viewer

Features

  • Discovers concrete Illuminate\Mail\Mailable classes in app/Mail
  • Renders a live HTML preview
  • Injects sample constructor data (scalars, Eloquent models, Statamic users/entries/forms)
  • Lets you edit strings, numbers, bools, and datetimes and see the preview update
  • Shows subject, from, attachments, template, queue status, and where the mailable is referenced
  • Sends a test email with sendNow()
  • Opens a chosen mailable directly via ?mailable=
  • Previews and sends in any site of a multisite install

Installation

You can install the Mailables Viewer addon via Composer:

composer require statamic/mailables-viewer

Then visit Utilities → Mailables in the Control Panel. Super users see it automatically. Everyone else needs the access mailables utility permission.

Usage

Any concrete mailable in app/Mail is discovered automatically.

Register mailables that live elsewhere:

use Statamic\MailablesViewer\Mailables;

Mailables::register(\App\Mail\Billing\InvoiceReady::class);

You can pass a class or an array of classes. The Mailables facade is also available as a Laravel alias.

Linking to a mailable

Add ?mailable= to the utility's URL to open the viewer with that mailable already selected:

cp_route('utilities.mailables', ['mailable' => \App\Mail\OrderShipped::class]);

Useful for a "preview this email" button elsewhere in the Control Panel. A class the viewer does not have falls back to the first mailable in the list.

Multisite

On a multisite install the viewer opens in the site selected in the Control Panel. The site dropdown, shown when you can access more than one site, reloads the viewer in that site: mailables are built, previewed and sent with the app locale set to the site's lang and with the site as the current one, so translations, globals and tags resolve in that site.

Add ?site= to link to a site. It combines with ?mailable=:

cp_route('utilities.mailables', ['site' => 'french', 'mailable' => \App\Mail\OrderShipped::class]);

A site you cannot access, or one that does not exist, falls back to the selected site. Without access to any site the viewer answers 403. Single-site installs are unaffected.

Constructor data

The viewer instantiates each mailable with sample values so you can preview it without writing a factory.

Type What happens
string, int, float, bool, datetimes Fake sample values you can edit in Details
Enums The first case, with the others to pick from in Details (a backed case shows its value alongside its name)
Statamic User, Entry, Form, Submission First available record
Eloquent models Factory make(), then query()->first(), then ::make()
Anything else Resolved from the container

Other objects and arrays stay read-only: an array shows as JSON, and so does a collection, cut at 500 characters; any other object shows its class name. Edit a scalar or pick an enum case and the preview plus envelope (subject, from, attachments) refresh live.

Sample strings are guessed from the parameter name (email → preview@example.com, name → Jane Doe, url → https://example.com).

Your own example values

Where the sample values fall short, such as an array of order lines that would otherwise be empty, a mailable can name its own. Implement HasPreviewExamples and return the values keyed by constructor parameter name:

use Statamic\MailablesViewer\Contracts\HasPreviewExamples;

class OrderShipped extends Mailable implements HasPreviewExamples
{
    public function __construct(
        public string $customer,
        public array $lines = [],
    ) {}

    public static function previewExamples(): array
    {
        return [
            'lines' => [['sku' => 'A-1', 'quantity' => 2]],
        ];
    }
}

An example wins over the parameter's default and the guessed sample; a value you edit in Details (scalars, datetimes and enums) wins over the example. Parameters you leave out are filled as before. In Details, a value that comes from previewExamples() carries an "Example from code" badge until you edit it. previewExamples() is called once per request.

Sending tests

Pick a mailable, optionally tweak the editable values, enter an address, and send. Tests use sendNow() so queued mailables still go out immediately.

Requirements

  • PHP 8.2+
  • Statamic 6

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP License
v1.1.0 ^8.2 MIT
v1.0.1 ^8.2 MIT
v1.0.0 ^8.2 MIT