定制 danielkellyio/mailgun-mailable 二次开发

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

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

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

What are mailgun tags?

<?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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-21