jeffersongoncalves / filament-mail-editor
Visual email template builder for Filament v5 with drag-and-drop blocks, live preview, and table-based HTML export.
Package info
github.com/jeffersongoncalves/filament-mail-editor
pkg:composer/jeffersongoncalves/filament-mail-editor
Requires
- php: ^8.3
- filament/filament: ^5.0
- jeffersongoncalves/laravel-mail-editor: ^1.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- livewire/livewire: ^4.0
- nunomaduro/collision: ^8.1
- nunomaduro/pao: 1.1.5
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-livewire: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Filament Mail Editor
Visual email template builder for Filament v5. A drag-and-drop Livewire editor that outputs table-based, inline-CSS HTML compatible with every major email client (Gmail, Outlook, Apple Mail).
The templates, blocks, rendering, workflow and Mail::template() integration live in jeffersongoncalves/laravel-mail-editor, which is installed automatically. This plugin adds the Filament admin: resources, the drag-and-drop builder and the block forms.
Version Compatibility
| Plugin Version | Filament |
|---|---|
| 1.x | v3 |
| 2.x | v4 |
| 3.x | v5 |
Features
- Drag-and-drop builder with live iframe preview (desktop/mobile/dark-mode), undo/redo and keyboard shortcuts
- Filament resources for templates, categories, brand kits, themes and the saved block library
- Review workflow actions (submit, approve, reject) with concurrent editing lock
- Quality panel — accessibility (WCAG), spam score, link validation, preheader/alt text
- Metrics widget for the dashboard
- Everything from laravel-mail-editor: 22 email-safe blocks, inline-CSS HTML and plain-text export, template variables, version history, A/B variants
Requirements
- PHP
^8.3 - Filament
^5.0 ext-gd(for countdown image rendering)
Installation
composer require jeffersongoncalves/filament-mail-editor:^3.0
Publish and run migrations
php artisan vendor:publish --tag="mail-editor-migrations"
php artisan migrate
Publish config (optional)
php artisan vendor:publish --tag="mail-editor-config"
Register the plugin in your Filament panel
use JeffersonGoncalves\FilamentMailEditor\FilamentMailEditorPlugin; public function panel(Panel $panel): Panel { return $panel->plugins([ FilamentMailEditorPlugin::make(), ]); }
Seed demo data (optional)
php artisan db:seed --class="JeffersonGoncalves\MailEditor\Database\Seeders\MailEditorSeeder"
Usage
Sending, rendering, variables and Artisan commands come from laravel-mail-editor — see its README. For example:
use Illuminate\Support\Facades\Mail; Mail::template('welcome-email', ['user_name' => $user->name])->to($user->email)->send();
Register a custom block
Register the block in config/mail-editor.php as described in laravel-mail-editor. To edit its props in the Filament block library, also implement JeffersonGoncalves\FilamentMailEditor\Blocks\Contracts\HasPropsSchema:
use Filament\Forms\Components\TextInput; use JeffersonGoncalves\FilamentMailEditor\Blocks\Contracts\HasPropsSchema; use JeffersonGoncalves\MailEditor\Blocks\AbstractEmailBlock; class MyCustomBlock extends AbstractEmailBlock implements HasPropsSchema { // type(), label(), icon(), defaultProps() ... public static function propsSchema(): array { return [ TextInput::make('title')->required(), ]; } }
Upgrading from 3.0
3.1 moved the Laravel core into jeffersongoncalves/laravel-mail-editor:
- Models, enums, events, support classes and the seeder moved from
JeffersonGoncalves\FilamentMailEditor\…toJeffersonGoncalves\MailEditor\…. - Config, migrations and translations of the core use the
mail-editorkey:config/mail-editor.php,--tag="mail-editor-migrations",--tag="mail-editor-config". - The preview and countdown routes moved from
/filament-mail-editor/*to/mail-editor/*(namesmail-editor.preview/mail-editor.countdown). - JSON exports use the
mail-editorformat id; files exported with the oldfilament-mail-editorid still import.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
