PHPackages                             devkea/laravel-mandrill-driver - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. devkea/laravel-mandrill-driver

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

devkea/laravel-mandrill-driver
==============================

Mandrill notification channel for Laravel 5, 6, 7, 8, 9

1.3(2y ago)042MITPHPPHP &gt;=7.0.0

Since Aug 24Pushed 2y agoCompare

[ Source](https://github.com/devkea/laravel-mandrill-driver)[ Packagist](https://packagist.org/packages/devkea/laravel-mandrill-driver)[ RSS](/packages/devkea-laravel-mandrill-driver/feed)WikiDiscussions master Synced 1mo ago

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

Source:

What's new:

1. Adding attached files;
2. Specifying a dynamic API key.

Installation
------------

[](#installation)

```
composer require devkea/laravel-mandrill-driver

```

Configure
---------

[](#configure)

Add into your .env file

```
MANDRILL_SECRET=YOUR_MANDRILL_API_KEY

```

In your `mail.php` file

```
'from' => [
    'address' => 'noreply@example.com',
    'name' => "From Name"
],

'mandrill' => [
    'key' => env('MANDRILL_SECRET', 'SUPER SECRET KEY')
]

```

Usage
-----

[](#usage)

#### Basic usage

[](#basic-usage)

```
public function via($notifiable)
{
    return [MandrillChannel::class];
}

public function toMandrill($notifiable)
{
    return (new MandrillMessage())
        ->subject('Purchase successful')
        ->addTo($notifiable->email)
        ->view('mandrill-template-name', [
            'product' => $this->product->toArray(),
            'user' => [
                'name' => $notifiable->name,
                'phone' => $notifiable->phone
            ]
        ]);
}
```

#### Advanced

[](#advanced)

```
public function toMandrill($notifiable)
{
    return (new MandrillMessage())
        ->subject('Purchase successful')
        ->templateName('mandrill-template-name')
        ->addTo($notifiable->email)
        ->addTos(['a@example.com', 'b@example.com'])
        ->fromName('Customized From')
        ->fromEmail('custom_from@example.com')
        ->replyTo('reply@example.com')
        ->attach($notifiable->file)
        ->content([
            'product' => $this->product->toArray(),
        ]);
}
```

Available methods
-----------------

[](#available-methods)

MethodTypeDescription`subject``string`Sets the email subject`templateName``string`Sets template name in Mandrill`addTo``string`Adds a To email`addTos``array`Adds multiple To emails`fromName``string`Overrides the default from name`fromEmail``string`Overrides the default from email`content``array`Content array`attach``array`Adds a file`replyTo``string`Accepts one parameter(`$email`)`view``function`Accepts 2 params (`$templateName`, `$keyedContentArray`)`setKey``string`Changes the API key**Note: To keep it consistent with laravel's `Mail` implementation of `replyTo`, you can pass two parameters, second parameter is ignored, and If `replyTo` is called multiple times only first one will be used and others will be ignored. Because mandrill only allows one email address for reply to.**

Usage in Mandrill (Dynamic Handlebars)
--------------------------------------

[](#usage-in-mandrill-dynamic-handlebars)

When specifying your content in the methods `content` or `view` you can then write in [handlebars syntax](https://mandrill.zendesk.com/hc/en-us/articles/205582537-Using-Handlebars-for-Dynamic-Content) in your Mandrill templates like this;

Hey `{{user.name}}`, you have successfully purchased `{{product.name}}`.

Mailchimp syntax
----------------

[](#mailchimp-syntax)

If you wish to use [Mailchimp Merge Tags](https://mandrill.zendesk.com/hc/en-us/articles/205582787-Mailchimp-Merge-Tags-Supported-in-Mandrill) instead of the dynamic handlebars then you can set the `$mergeLanguage` optional param in `templateName` method to `mailchimp`.

In mailchimp merge tags, arrays are not supported, so each tag only accepts a string. [Full documentation including booked keywords on mandrill](https://mandrill.zendesk.com/hc/en-us/articles/205582787-Mailchimp-Merge-Tags-Supported-in-Mandrill)

#### Mailchimp Example

[](#mailchimp-example)

```
public function toMandrill($notifiable)
{
    return (new MandrillMessage())
        ->subject('Purchase successful')
        ->templateName('mandrill-template-name', 'mailchimp') addTo($notifiable->email)
        ->content([
            'customer_name' => $notifiable->name,
            'invoice_link' => 'http://example.com/download/invoice.pdf',
        ])
}
```

Then in your mandrill template use as follows;

Hi `*|customer_name|*`, you can download your invoice from here `*|invoice_link|*`,

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.6% 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

Unknown

Total

1

Last Release

989d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef53d7eca5c7afabeae541260fe05663a0614851d41bee57b065eb0f402ecae4?d=identicon)[professordace](/maintainers/professordace)

---

Top Contributors

[![salamwaddah](https://avatars.githubusercontent.com/u/26627088?v=4)](https://github.com/salamwaddah "salamwaddah (46 commits)")[![developernaren](https://avatars.githubusercontent.com/u/3628468?v=4)](https://github.com/developernaren "developernaren (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![Joorren](https://avatars.githubusercontent.com/u/22602428?v=4)](https://github.com/Joorren "Joorren (2 commits)")[![saddamhussain734](https://avatars.githubusercontent.com/u/19436104?v=4)](https://github.com/saddamhussain734 "saddamhussain734 (1 commits)")[![devkea](https://avatars.githubusercontent.com/u/17526143?v=4)](https://github.com/devkea "devkea (1 commits)")[![wblommaert](https://avatars.githubusercontent.com/u/5678605?v=4)](https://github.com/wblommaert "wblommaert (1 commits)")

---

Tags

laravellaravel 6laravel 7laravel 8laravel 9laravel 10notificationslaravel 5mailchimpmandrillchannel

### Embed Badge

![Health badge](/badges/devkea-laravel-mandrill-driver/health.svg)

```
[![Health](https://phpackages.com/badges/devkea-laravel-mandrill-driver/health.svg)](https://phpackages.com/packages/devkea-laravel-mandrill-driver)
```

###  Alternatives

[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[salamwaddah/laravel-mandrill-driver

Mandrill notification channel for Laravel 5, 6, 7, 8, 9, 10, 11, 12

1174.3k](/packages/salamwaddah-laravel-mandrill-driver)[novu/novu-laravel

Novu for Laravel

12204.3k](/packages/novu-novu-laravel)[itsmurumba/laravel-mpesa

Laravel Package for Mpesa Daraja API

191.6k](/packages/itsmurumba-laravel-mpesa)

PHPackages © 2026

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