Download the PHP package basementdevs/filament-better-mails without Composer
On this page you can find all versions of the php package basementdevs/filament-better-mails. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download basementdevs/filament-better-mails
More information about basementdevs/filament-better-mails
Files in basementdevs/filament-better-mails
Package filament-better-mails
Short Description This is my package filament-better-mails
License MIT
Homepage https://github.com/basementdevs/filament-better-mails
Informations about the package filament-better-mails
Filament Better Mails
A Filament v5 plugin that automatically logs every outgoing email, tracks delivery events via provider webhooks, and gives you a full-featured admin panel to browse, preview, and resend emails.
Features
- Zero-config email logging -- every outgoing email is captured automatically
- Webhook-based delivery tracking -- delivered, opened, clicked, bounced, complained, and more
- Email preview -- rendered HTML, raw HTML source, and plain text views
- Resend emails -- individually or in bulk with custom recipients
- Send test emails -- simple or with attachments, directly from the admin panel
- Attachment storage -- stored to disk with download support
- Dashboard stats widget -- delivery, open, click, and bounce rates at a glance
- Fully config-driven -- customize table names, swap models, configure resource navigation
- Auto-pruning -- schedule cleanup of old email records
- Dark mode support
Requirements
- PHP 8.3+
- Laravel 12.x or 13.x
- Filament 5.x
Installation
Install the package via Composer:
Publish and run the migrations:
Publish the config file:
Setup
1. Register the Plugin
Add the plugin to your Filament panel provider:
2. Configure Your Email Provider
Set your provider credentials in .env:
3. Register Webhook URL
Point your email provider's webhook settings to:
This route is automatically registered and CSRF-exempt.
How It Works
Email Capture Flow
The package hooks into Laravel's mail events automatically. No changes to your existing mail code are required.
Webhook Tracking Flow
When your email provider processes the email, it sends delivery events back:
Tracked Events
| Event | Color | Description |
|---|---|---|
| Sent | Gray | Email dispatched from your app |
| Accepted | Green | Provider accepted the email |
| Scheduled | Amber | Email scheduled for future delivery |
| Delivered | Blue | Email reached recipient's inbox |
| Opened | Green | Recipient opened the email |
| Clicked | Teal | Recipient clicked a link in the email |
| Soft Bounced | Red | Temporary delivery failure |
| Hard Bounced | Red | Permanent delivery failure |
| Complained | Indigo | Recipient marked as spam |
| Unsubscribed | Gray | Recipient unsubscribed |
| Suppressed | Orange | Email suppressed by provider |
Configuration
Full configuration reference
Models
Swap the default models with your own by extending the base classes:
All internal references resolve from config, so your custom models are used throughout the package.
Database Tables
Customize table names to avoid conflicts:
Resource Navigation
Customize how the resource appears in the Filament sidebar:
Pruning
Enable automatic cleanup of old records:
Then schedule the prune command in your routes/console.php:
Attachment Logging
Control whether attachments are stored to disk:
Webhook Logging
Enable detailed webhook logging for debugging:
Filament Admin Panel
Email List Page
The list page provides:
- Tabs -- filter by event type (All, Sent, Delivered, Opened, Clicked, Bounced, etc.) with badge counts
- Search -- across subject, HTML body, plain text, and recipients
- Sort -- by subject, opens, clicks, or sent date
- Pagination -- 50, 100, or all records
Table Columns
| Column | Description |
|---|---|
| Subject | Email subject line (searchable) |
| Attachments | Paper clip icon if email has attachments |
| Recipient(s) | To addresses |
| Status | Color-coded badges for each event in the timeline |
| Opens | Open count with tooltip showing last opened date |
| Clicks | Click count with tooltip showing last clicked date |
| Sent At | Relative time with exact date tooltip |
Email Detail View
View full email details in a slideOver modal with three sections:
General
- Sender Info tab: from, to, cc, bcc, reply-to, subject
- Statistics tab: open/click counts, timestamps for each delivery stage
- Events tab: chronological timeline of all webhook events
Content
- Preview tab: rendered HTML in an iframe
- HTML tab: raw HTML source with copy button
- Text tab: plain text version with copy button
Attachments
- File metadata (name, size, MIME type)
- Download links
Actions
| Action | Type | Description |
|---|---|---|
| View | Record | Open email detail in a slideOver modal |
| Resend | Record | Resend email to custom recipients (to, cc, bcc) |
| Bulk Resend | Bulk | Resend selected emails, pre-filled with original recipients |
| Send Test Email | Header | Send a simple or attachment test email to verify setup |
| Delete | Bulk | Delete selected email records |
Stats Widget
The dashboard widget shows four metrics as percentages:
| Stat | Color | Description |
|---|---|---|
| Delivered | Green | Delivery rate |
| Opened | Blue | Open rate |
| Clicked | Teal | Click rate |
| Bounced | Red | Bounce rate (soft + hard) |
Each stat links to its corresponding filter tab. Toggle visibility with 'view_any' => false.
Extending the Package
Custom Models
Extend the base models and update the config:
Custom Webhook Providers
-
Create a driver implementing
BetterDriverContract: -
Add the provider enum case to
SupportedMailProvidersEnum - Register in config:
Polymorphic Relationships
The package creates a mailables polymorph table for associating emails with any model:
Publishing Views
Customize the Blade templates:
| View | Purpose |
|---|---|
preview.blade.php |
Email preview iframe wrapper |
html.blade.php |
HTML content display |
mails/html.blade.php |
HTML source with syntax highlighting |
mails/preview.blade.php |
Iframe preview component |
mails/download.blade.php |
Attachment download button |
mails/test/simple.blade.php |
Simple test email template |
mails/test/attachment.blade.php |
Attachment test email template |
tables/columns/mail-status.blade.php |
Status badge column |
Environment Variables
| Variable | Default | Description |
|---|---|---|
MAIL_MAILER |
smtp |
Laravel mail driver (set to resend) |
RESEND_API_KEY |
-- | Resend API key |
RESEND_WEBHOOK_SECRET |
-- | Resend webhook signing secret |
MAILS_WEBHOOK_PROVIDER |
resend |
Active webhook provider |
MAILS_WEBHOOK_LOGGING_ENABLED |
false |
Enable webhook debug logging |
MAILS_WEBHOOK_LOG_CHANNEL |
-- | Custom log channel for webhooks |
MAILS_LOGGING_ATTACHMENTS_ENABLED |
true |
Store email attachments to disk |
FILESYSTEM_DISK |
local |
Storage disk for attachments |
Supported Providers
| Provider | Status |
|---|---|
| Resend | Supported |
Testing
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
- Daniel Reis
- RichardGL11
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-better-mails with dependencies
filament/filament Version ^5.0
illuminate/contracts Version ^12.0||^13.0
resend/resend-laravel Version ^1.0
spatie/laravel-package-tools Version ^1.16