定制 motsmanish/cakephp-mailgun 二次开发

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

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

motsmanish/cakephp-mailgun

最新稳定版本:v1.0.3

Composer 安装命令:

composer require motsmanish/cakephp-mailgun

包简介

Send mail via Mailgun SDK in CakePHP 3.0

README 文档

README

Send mail via Mailgun SDK in CakePHP 3.0

Requirements

  • PHP 5.4+
  • Mailgun SDK ~1.7.2
  • CakePHP 3.x

Installation Steps

    1. Install using composer
composer require motsmanish/cakephp-mailgun
    1. Updated configuration in app.php
'EmailTransport' => [
		'default' => [
			...
		],
		'mailgun' => [
			 'className' => 'MailgunEmail\Mailer\Transport\MailgunTransport'
		],
	],
	'Email' => [
		'default' => [
			...
		],
		'mailgun' => [
			'transport' => 'mailgun',
			'mailgun_domain' => 'example.com', //required
			'mailgun_api_key' => 'key-xxxxxxxxxxxxxxxxxxxxxxxxx',  //required
			'mailgun_postbin_id' => '' //optional, provide postbin id only when you want to debug messages on http://bin.mailgun.net/ instead of actually sending
		],
	],

And you are good to go.

Usage

// load Email class
use Cake\Mailer\Email;

// send mail by setting all the required properties 
$email = new Email('mailgun');
$result = $email->from(['me@example.com' => 'My Site'])
	->to('you@example.com')
	->subject('Hello')
	
	//->template('get_in_touch')
	//->viewVars(['to' => 'You', 'from' => 'Me'])
	//->emailFormat('both')
	
	->addHeaders(['o:tag' => 'testing'])
	->addHeaders(['o:deliverytime' => strtotime('+1 Min')])
	->addHeaders(['v:my-custom-data' => json_encode(['max' => 'testing'])])
	
	->readReceipt('admin@example.com')
	->returnPath('bounce@example.com')
	
	->attachments([
		'cake_icon1.png' => Configure::read('App.imageBaseUrl') . 'cake.icon.png',
		'cake_icon2.png' => ['file' => Configure::read('App.imageBaseUrl') . 'cake.icon.png'],
		WWW_ROOT . 'favicon.ico'
	])
	
	->send('How are you?');

统计信息

  • 总下载量: 21.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固