oltrematica/laravel-pulse-mail
Composer 安装命令:
composer require oltrematica/laravel-pulse-mail
包简介
Laravel Pulse Mail
README 文档
README
Laravel Pulse Mail
Track and monitor emails sent from your Laravel application directly in your Laravel Pulse dashboard.
This package provides a custom Pulse widget that displays sent emails with details including recipients, subjects, mailable classes, and send counts. Perfect for monitoring email activity and debugging mail-related issues in production.
Features
- 📧 Track all sent emails - Automatically records emails sent via Laravel Mail
- 🎯 Detailed information - Shows recipient, subject, mailable class, and send count
- ⚙️ Configurable filtering - Exclude specific emails or mailables from tracking
- 📊 Sample rate control - Track a percentage of emails for high-volume applications
- 🕐 Time-based filtering - Uses Pulse's built-in date filtering
- 🎨 Consistent UI - Matches Pulse's design language
Requirements
- PHP 8.3+
- Laravel 10.x, 11.x, or 12.x
- Laravel Pulse 1.x
Installation
Step 1: Install the Package
Install the package via Composer:
composer require oltrematica/laravel-pulse-mail
Step 2: Publish Configuration Files
Publish the package configuration file:
php artisan vendor:publish --tag=pulse-mail-config
If you haven't already published the Pulse dashboard view, publish it as well:
php artisan vendor:publish --tag=pulse-dashboard
Step 3: Configure Pulse Recorder
Add the mail recorder to your config/pulse.php file in the recorders array:
'recorders' => [ // ... other recorders \Oltrematica\Pulse\Mail\Recorders\MailSentRecorder::class => [ 'enabled' => env('PULSE_MAIL_ENABLED', true), ], ],
Step 4: Add Widget to Dashboard
Add the mail-sent widget to your Pulse dashboard in resources/views/vendor/pulse/dashboard.blade.php:
<x-pulse> <livewire:pulse.servers cols="full" /> <livewire:pulse.usage cols="4" rows="2" /> <livewire:pulse.queues cols="4" /> <livewire:pulse.cache cols="4" /> {{-- Custom: Mail Sent Widget --}} <livewire:pulse.mail-sent cols="8" /> <livewire:pulse.slow-queries cols="8" /> <livewire:pulse.slow-jobs cols="4" /> <livewire:pulse.slow-requests cols="full" /> <livewire:pulse.exceptions cols="6" /> <livewire:pulse.slow-outgoing-requests cols="6" /> </x-pulse>
You can customize the widget size using the cols and rows attributes. Common configurations:
cols="full"- Full widthcols="8"- 2/3 widthcols="6"- Half widthcols="4"- 1/3 width
Configuration
The config/pulse-mail.php file provides several options:
return [ // Maximum number of emails to display in the widget 'limit' => env('PULSE_MAIL_LIMIT', 10), // Email addresses to exclude from tracking 'ignore' => [ 'to' => [ // 'test@example.com', ], ], // Mailable classes to exclude from tracking 'ignore_mailables' => [ // \App\Mail\TestEmail::class, ], // Sample rate (0-1): 1 = track all emails, 0.5 = track 50% 'sample_rate' => env('PULSE_MAIL_SAMPLE_RATE', 1), ];
Usage
Once installed and configured, the package will automatically start tracking emails sent through Laravel's Mail facade or Mailable classes. The widget will display:
- To: Email recipient address(es)
- Subject: Email subject line
- Mailable: The Mailable class used (if applicable)
- Count: Number of times this email was sent during the selected period
Filtering
The widget respects Pulse's time-based filtering. Use the Pulse dashboard controls to filter emails by time period (last hour, 24 hours, 7 days, etc.).
Ignoring Specific Emails
To exclude certain emails from tracking, add them to the configuration:
// Ignore by recipient 'ignore' => [ 'to' => [ 'test@example.com', 'noreply@example.com', ], ], // Ignore by Mailable class 'ignore_mailables' => [ \App\Mail\TestEmail::class, \App\Mail\InternalNotification::class, ],
Sample Rate
For high-volume applications, you can track only a percentage of emails:
// Track 50% of emails 'sample_rate' => 0.5, // Or use environment variable 'sample_rate' => env('PULSE_MAIL_SAMPLE_RATE', 1),
Viewing Emails in Real-Time
Laravel Pulse uses an ingest system that processes recorded data asynchronously. After sending emails, you need to run the Pulse ingest process to see them in the dashboard:
Option 1: Manual Ingest (Development)
Run this command to process pending data once:
php artisan pulse:check
Option 2: Automatic Ingest (Recommended)
Run the Pulse worker in the background to automatically process data:
php artisan pulse:work
For development environments, add pulse:work to your concurrent processes. For example, if using concurrently in your composer dev script:
"dev": [ "npx concurrently \"php artisan serve\" \"php artisan queue:listen\" \"php artisan pulse:work\" \"npm run dev\"" ]
Option 3: Production Setup
In production, configure a supervisor process to keep pulse:work running continuously. See the Laravel Pulse documentation for details.
Code Quality
The project includes automated tests and tools for code quality control.
Rector
Rector is a tool for automating code refactoring and migrations. It can be run using the following command:
composer refactor
PhpStan
PhpStan is a tool for static analysis of PHP code. It can be run using the following command:
composer analyse
Pint
Pint is a tool for formatting PHP code. It can be run using the following command:
composer format
Automated Tests
The project includes automated tests and tools for code quality control.
composer test
Contributing
Feel free to contribute to this package by submitting issues or pull requests. We welcome any improvements or bug fixes you may have.
oltrematica/laravel-pulse-mail 适用场景与选型建议
oltrematica/laravel-pulse-mail 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.71k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mail」 「laravel」 「utilities」 「oltrematica」 「pulse-mail」 「pulse dashboard」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oltrematica/laravel-pulse-mail 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oltrematica/laravel-pulse-mail 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oltrematica/laravel-pulse-mail 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A collection of enhancements and utilities for the Silverstripe UserForms module
Courier offers a convenient and painless solution for creating emails tailored for your Kirby website.
Mail libraries used by Zimbra Api
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Reusable utilities library for Lacus Solutions' packages (type description, HTML escaping, random sequences)
Laravel IMAP client
统计信息
- 总下载量: 3.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-20

