PHPackages                             jlinn/mandrill-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jlinn/mandrill-api-php

ActiveLibrary[API Development](/categories/api)

jlinn/mandrill-api-php
======================

A PHP client library for Mandrill's REST API

v1.1.1(10y ago)24120.2k↓27.3%12[1 issues](https://github.com/jlinn/mandrill-api-php/issues)MITPHPPHP &gt;=5.3.2

Since Sep 16Pushed 10y ago4 watchersCompare

[ Source](https://github.com/jlinn/mandrill-api-php)[ Packagist](https://packagist.org/packages/jlinn/mandrill-api-php)[ RSS](/packages/jlinn-mandrill-api-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (2)Versions (8)Used By (0)

mandrill-api-php
================

[](#mandrill-api-php)

[![Build Status](https://camo.githubusercontent.com/680ff993b9697e3900c57757cd6c8d11c3d3724144ebaea02f410b02cf124f45/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a6c696e6e2f6d616e6472696c6c2d6170692d7068702e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/jlinn/mandrill-api-php)

A PHP client library for [Mandrill's API](https://mandrillapp.com/api/docs/).

This library provides all of the functionality present in the [official PHP client](https://bitbucket.org/mailchimp/mandrill-api-php/), but makes use of namespaces and provides helper classes to ease message sending.

Installation Using [Composer](http://getcomposer.org/)
======================================================

[](#installation-using-composer)

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

```
php composer.phar require jlinn/mandrill-api-php:~1.0
```

Usage
=====

[](#usage)

Sending a Message
-----------------

[](#sending-a-message)

```
use Jlinn\Mandrill\Mandrill;
use Jlinn\Mandrill\Struct\Message;
use Jlinn\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);
```

Usage with Laravel 4.x
======================

[](#usage-with-laravel-4x)

We have built a factory so that it's easier to use with Laravel 4.x facades.

Configuration
-------------

[](#configuration)

In order to publish the package configuration you need to perform the following command:

```
php artisan config:publish jlinn/mandrill-api-php

```

Change then the `secret` variable with your Mandrill secret key.

Sending a Message
-----------------

[](#sending-a-message-1)

```
// instantiate a client object
$api = Mandrill::api();

// instantiate a message object
$message = Mandrill::message([
    'text'       => 'Hello, *|NAME|*!',
    'subject'    => 'Test',
    'from_email' => 'test@example.com',
    'from_name'  => 'Mandrill API Test'
]);

// instantiate a Recipient object and add details
$recipient = Mandrill::recipient('recipient.email@example.com', 'Recipient Name');
$recipient->addMergeVar('NAME', $recipient->name);

// add the recipient to the message
$message->addRecipient($recipient);

// send the message
$response = $api->messages()->send($message);
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 53.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~133 days

Recently: every ~177 days

Total

7

Last Release

3872d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2254b2664ffc343c45b480067d473c9c5912b41452420efe677adc2e75db3621?d=identicon)[jlinn](/maintainers/jlinn)

---

Top Contributors

[![jlinn](https://avatars.githubusercontent.com/u/4562038?v=4)](https://github.com/jlinn "jlinn (8 commits)")[![GiamPy5](https://avatars.githubusercontent.com/u/4460702?v=4)](https://github.com/GiamPy5 "GiamPy5 (7 commits)")

---

Tags

mandrill

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jlinn-mandrill-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/jlinn-mandrill-api-php/health.svg)](https://phpackages.com/packages/jlinn-mandrill-api-php)
```

###  Alternatives

[rackspace/php-opencloud

PHP SDK for Rackspace/OpenStack APIs

4566.0M38](/packages/rackspace-php-opencloud)[cdaguerre/php-trello-api

Trello API v2 client

256677.1k3](/packages/cdaguerre-php-trello-api)[dchesterton/marketo-rest-api

A PHP client for the Marketo.com REST API

39844.4k1](/packages/dchesterton-marketo-rest-api)[carlosio/geckoboard

A PHP library for dealing with Geckoboard API (http://www.geckoboard.com)

40172.9k](/packages/carlosio-geckoboard)[teepluss/api

Laravel 4 Internal Request (HMVC)

7034.1k](/packages/teepluss-api)[codemix/yiielasticsearch

Elastic Search client for Yii

3342.8k](/packages/codemix-yiielasticsearch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
