danielkellyio/mailgun-mailable
最新稳定版本:1.0.4
Composer 安装命令:
composer require danielkellyio/mailgun-mailable
包简介
A trait to make your laravel mailables smarter about working with mailgun
README 文档
README
A trait to make your laravel mailables smarter about working with mailgun.
Note - not used to send your mail with Mailgun. Use with mail that's already being sent with Mailgun using Laravel's out of the box Mailgun driver. Provides some helper methods to deal with unique Mailgun features like variables and tags.
Installation
composer require danielkellyio/mailgun-mailable
Add tags to an email
<?php use DanielKellyIO\MailgunMailable\MailgunMailable; // ... class YourEmail extends Mailable { use MailgunMailable; public function build() { $this->tags(['tag-1', 'tag-2']); // ... } }
Add variables to an email
(Can be used to manage email templates within the Mailgun interface. More info)
<?php use DanielKellyIO\MailgunMailable\MailgunMailable; // ... class YourEmail extends Mailable { use MailgunMailable; public function build() { $this->variables([ 'greeting' => 'Hello', 'name' => 'Daniel' ]); // ... } }
No mailable class?
Using send with a callback to compose message? Add tags and variables directly to messages like so:
use DanielKellyIO\MailgunMailable\MailgunHelpers; Mail::send( 'your-email-template', [], function ( $m ) { $m->to( 'test@test.com' )->subject( 'Test Email' ); MailgunHelpers::tags($m, ['tag-1', 'tag-2']); MailgunHelpers::variables($m, [ 'greeting' => 'Hello', 'name' => 'Daniel' ]); });
统计信息
- 总下载量: 557
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-21