2017 © Pedro Peláez
 

library mandrill-zend3

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

image

awsm3/mandrill-zend3

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

  • Sunday, April 1, 2018
  • by AWSM3
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 20 % Grown

The README.md

Mandrill API for Zend Framework 3

A PHP ZF3 client library for Mandrill's API., (*1)

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)., (*2)

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

Installation Using Composer

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

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);

The Versions

01/04 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

zend framework mandrill zf3 zend framework 3

01/04 2018

3.0

3.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

zend framework mandrill zf3 zend framework 3

27/10 2015

2.1

2.1.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

zf2 mandrill

26/10 2015

2.0

2.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

zf2 mandrill