ptejada/laravel-mailgun-options
Composer 安装命令:
composer require ptejada/laravel-mailgun-options
包简介
Laravel mailgun driver helper to toggle email opens, clicks, tag emails and more per mailable.
README 文档
README
The package enhances the builtin Laravel Mailgun driver with helpers to manage the Mailgun specific features in a per email message basis. The following options can be configures with the helper:
- Toggle tracking email opens.
- Toggle tracking email link clicks.
- Add email tags.
- Attach variables and recipient variables to email.
- Enable test mode.
- Schedule email to be delivery in the future.
Refer to the Send via SMTP section of the Mailgun API docs for more information.
Installation
Install package via composer
composer require ptejada/laravel-mailgun-options
Compatibility
The package is tested and should be compatible with the following PHP and Laravel versions
| PHP | Laravel |
|---|---|
| 7.3 | 7.x |
| 7.4 | 7.x, 8.x |
| 8.0 | 7.x, 8.x, 9.x |
| 8.1 | 8.x, 9.x |
Usage
Add the PabloTejada\MailgunOptions\MailgunOptions trait to any mailable class you want to configure. Within the
build method of the mailable you can configure the Mailgun options using the following helpers:
- track() - Track both email opens and clicks.
- trackClicks() - Track when links in the email ar clicked.
- trackOpens() - Track when the email is opened.
- deliverBy() - Schedules the email to be deliver at a later time.
- testMode() - Sends the email in test mode.
- tags() - Adds one or more tags to the email.
- variables - Attach variables to the email.
- recipientVariables - Attach recipient specific variables to the email.
- dkimSignature - Toggles the DKIM signatures.
Example mailable class
<?php namespace App\Email; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; use PabloTejada\MailgunOptions\MailgunOptions; class EmailNotification extends Mailable { use Queueable, SerializesModels, MailgunOptions; /** * @return EmailNotification */ public function build() { $this->to('pablo@tejada.dev', 'Pablo Tejada'); // Track email opens and clicks $this->track(); // Add email tag or campaign $this->tags('Test Campaign'); // Enables the test mode if the app is not in production if ( ! app()->environement('production') ) { $this->testMode(); } return $this->markdown('email'); } }
License
Laravel Mailgun Options is open-source software licensed under the MIT license.
ptejada/laravel-mailgun-options 适用场景与选型建议
ptejada/laravel-mailgun-options 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 36 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「mailgun」 「Email Tracking」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ptejada/laravel-mailgun-options 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ptejada/laravel-mailgun-options 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ptejada/laravel-mailgun-options 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Send emails from multiple domains with mailgun
Mailgun integration for SilverStripe emails
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Laravel contact us form package to send email and save to database
Alfabank REST API integration
统计信息
- 总下载量: 36
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-27