basementdevs/filament-better-mails

This is my package filament-better-mails

Maintainers

Package info

github.com/basementdevs/filament-better-mail

Homepage

pkg:composer/basementdevs/filament-better-mails

Fund package maintenance!

Basement Developers

Statistics

Installs: 53

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

5.0.0 2026-02-27 21:37 UTC

This package is auto-updated.

Last update: 2026-02-27 21:38:16 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package that provides a complete implementation to track mails, starting to send the mail and receiving back mail's events by webhooks, currently the supported mailer is Resend, and a Filament v4 resource to view sent mails in your admin panel. It ships with:

Overview of the stack

  • Language: PHP 8.3
  • Framework: Laravel (Illuminate 12.x APIs)
  • Admin: Filament v4
  • Package manager: Composer
  • Testing: Pest + Orchestra Testbench

Requirements

  • PHP ^8.3
  • Laravel 12.x compatible application
  • Filament ^4.0 installed in the host app
  • Composer

Installation

You can install the package via composer:

composer require basementdevs/filament-better-mails

You can publish and run the migrations with:

php artisan vendor:publish --tag="filament-better-mails-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="filament-better-mails-config"

This is the contents of the published config file:

return [
 'mails' => [
        'models' => [
            'mail' => BetterEmail::class,
            'event' => BetterEmailEvent::class,
            'attachment' => BetterEmailAttachment::class,
        ],
        'database' => [
            'tables' => [
                'mails' => 'mails',
                'attachments' => 'mail_attachments',
                'events' => 'mail_events',
                'polymorph' => 'mailables',
            ],
            'pruning' => [
                'enabled' => false,
                'after' => 30, // days
            ],
        ],

        'headers' => [
            'key' => 'X-Better-Mails-Event-ID'
        ],

        'logging' => [
            'attachments' => [
                'enabled' => env('MAILS_LOGGING_ATTACHMENTS_ENABLED', true),
                'disk' => env('FILESYSTEM_DISK', 'local'),
                'root' => 'mails/attachments',
            ],
        ]
    ],
    'webhooks' => [
        'provider' => env('MAILS_WEBHOOK_PROVIDER', 'resend'),

        'drivers' => [
            'resend' => [
                'driver' => ResendDriver::class,
                'key_secret' => env('RESEND_WEBHOOK_SECRET', ''),
            ],
        ]
    ]
];

Environment variables

Resend credentials and defaults are required by your application. The following are commonly used; verify in your project:

MAIL_MAILER=resend
RESEND_API_KEY=
RESEND_WEBHOOK_SECRET=

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-better-mails-views"

Usage

To use the Filament Resource you must add the FilamentBetterEmailPlugin at your panel provider.

use Basement\BetterMails\Filament\FilamentBetterEmailPlugin;

        ->plugins([
               FilamentBetterEmailPlugin::make(),
            ])

The resource track all mails sent based on their status, also has a widget and actions to resend this mails again.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.