awsm3/mandrill-zend3 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

awsm3/mandrill-zend3

Composer 安装命令:

composer require awsm3/mandrill-zend3

包简介

A PHP client library for Mandrill's REST API for Zend Framework 3

README 文档

README

A PHP ZF3 client library for Mandrill's API.

This library provides all of the functionality present in the official PHP client, but makes use of namespaces, provides helper classes to ease message sending and works with Zend Framework 3 (uses its library).

This library based on Joe Linn's library (https://github.com/jlinn/mandrill-api-php).

Installation Using Composer

Assuming composer.phar is located in your project's root directory, run the following command:

composer require awsm3/mandrill-zend3

Usage

Sending a Message

/** @uses */
use Mandrill\Mandrill;
use Mandrill\Struct\Message;
use Mandrill\Struct\Recipient;
 
// instantiate a client object
$mandrill = new Mandrill('your_api_key');
 
// instantiate a Message object
$message = new Message();
 
// define message properties
$message->text = 'Hello, *|NAME|*!';
$message->subject = 'Test';
$message->from_email = 'test@example.com';
$message->from_name = 'Mandrill API Test';
 
// instantiate a Recipient object and add details
$recipient = new Recipient();
$recipient->email = 'recipient.email@example.com';
$recipient->name = 'Recipient Name';
$recipient->addMergeVar('NAME', $recipient->name);
 
// add the recipient to the message
$message->addRecipient($recipient);
 
// send the message
$response = $mandrill->messages()->send($message);

Sending a ZF3 Message

/** @uses */
use Mandrill\Mandrill;
use Mandrill\Struct\Message;
 
// convert from ZF message
// $zfMessage is instance of \Zend\Mail\Message
$message = Message::convertZFMail($zfMessage);
 
// add any field you want
$message->metadata = ...;
 
// instantiate a client object
$mandrill = new Mandrill('your_api_key');
 
// send the message
$response = $mandrill->messages()->send($message);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固