定制 label84/laravel-mailviewer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

label84/laravel-mailviewer

Composer 安装命令:

composer require label84/laravel-mailviewer

包简介

View mails sent by Laravel in the browser

README 文档

README

Latest Stable Version MIT Licensed Total Downloads GitHub Workflow Status

Mailviewer enables you to view and filter mail that is sent by your Laravel application in the browser. The Analytics page gives you insight in the amount of mails sent sent by your application grouped by Notification.

MailViewer screenshot

Laravel Support

Version Release
12.x ^3.4
12.x ^3.4
11.x ^3.0

Limitations

This package tracks mails sent via Laravel's Mailables and Notifications.

Installation

1. Require package

composer require label84/laravel-mailviewer

2. Publish the config file and migration

php artisan vendor:publish --provider="Label84\MailViewer\MailViewerServiceProvider" --tag="config"
php artisan vendor:publish --provider="Label84\MailViewer\MailViewerServiceProvider" --tag="migrations"

2.1 Publish the views (optional)

To change the default views, you can publish them to your application.

php artisan vendor:publish --provider="Label84\MailViewer\MailViewerServiceProvider" --tag="views"

3. Run migrations

Run the migration command.

php artisan migrate

Usage

To preview the mails sent by your application visit: /admin/mailviewer. You can change this url in the config file.

You can add MAILVIEWER_ENABLED=true to your .env file.

Filters

You can filter the mails in the overview with query parameters - example /admin/mailviewer?notification=WelcomeMail.

Parameter Value Example
to= email info@example.com
cc= email info@example.com
bcc= email info@example.com
notification= class basename of Notification VerifyEmail
from= Carbon 2 hours ago
till= Carbon yesterday
around= Carbon 2020-12-24 06:00

The 'notification' parameter only requires the class basename (ie. \Illuminate\Auth\Notifications\VerifyEmail = VerifyEmail).

The around parameter show all mails sent around the given time. By default is will show all mails sent 10 minutes before and 10 minutes after the given time. You can customize the number of minutes by adding an additional &d=X parameter where X is the number of minutes.

Analytics

MailViewer Analytics screenshot

To preview the analytics page visit: /admin/mailviewer/analytics. You can change this url in the config file.

On the analytics page you can view the number of mails sent per Notification and the latest time this notification was sent.

Examples

Example #1

View all VerifyEmail mails to info@example.com.

/admin/mailviewer?to=info@example.com&notification=VerifyEmail

Example #2

View all mails sent in the last 2 hours.

/admin/mailviewer?from=2 hours ago

Exclusion list

In the config file you can add an array of Notification classes and an array of email addresses that should be excluded. Those notifications and email addresses won't be saved to the database.

Tests

composer pint
composer analyse
composer test

License

MIT

label84/laravel-mailviewer 适用场景与选型建议

label84/laravel-mailviewer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31.58k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2020 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 label84/laravel-mailviewer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 label84/laravel-mailviewer 我们能提供哪些服务?
定制开发 / 二次开发

基于 label84/laravel-mailviewer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 31.58k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-22