PHPackages                             eventhomes/laravel-mandrillhooks - 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. eventhomes/laravel-mandrillhooks

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

eventhomes/laravel-mandrillhooks
================================

A simple Mandrill webhook controller to help with events. Compatible with Laravel 5+ and Lumen 5+.

v2.0(6y ago)6375.5k↓33.3%12MITPHPPHP &gt;=5.5.9

Since Jul 22Pushed 5y ago5 watchersCompare

[ Source](https://github.com/eventhomes/laravel-mandrillhooks)[ Packagist](https://packagist.org/packages/eventhomes/laravel-mandrillhooks)[ RSS](/packages/eventhomes-laravel-mandrillhooks/feed)WikiDiscussions develop Synced 2d ago

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

Laravel Mandrill Webhook Controller
===================================

[](#laravel-mandrill-webhook-controller)

[![Latest Version](https://camo.githubusercontent.com/e58309a9118ebb6459d37eefcc6277119c28f0e69075def1bae763898ab9a617/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6576656e74686f6d65732f6c61726176656c2d6d616e6472696c6c686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://github.com/eventhomes/laravel-mandrillhooks/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/5c4df4f34c9bb874ee56b27e812cdf745478852399fd4a2ba5ca76ab23e6ae4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6576656e74686f6d65732f6c61726176656c2d6d616e6472696c6c686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eventhomes/laravel-mandrillhooks)

A simple Mandrill webhook controller to help with email events. Useful for notifying users that you cannot reach them via email inside your application. Compatible with Laravel 5+ and Lumen 5+.

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

[](#installation)

`composer require eventhomes/laravel-mandrillhooks`

Basic Usage
-----------

[](#basic-usage)

1. Create a controller that extends MandrillWebhookController as follows. You can then handle any Mandrillapp webhook event.

```
use EventHomes\Api\Webhooks\MandrillWebhookController;

class MyController extends MandrillWebhookController {

    /**
     * Handle a hard bounced email
     *
     * @param $payload
     */
    public function handleHardBounce($payload)
    {
        $email = $payload['msg']['email'];
    }

    /**
     * Handle a rejected email
     *
     * @param $payload
     */
    public function handleReject($payload)
    {
        $email = $payload['msg']['email'];
    }
}
```

2. Create the route to handle the webhook. In your routes.php file add the following.

```
post('mandrill-webhook', ['as' => 'mandrill.webhook', 'uses' => 'MandrillController@handleWebHook']);
```

3. [Exclude your route from CSRF protection](https://laravel.com/docs/5.4/csrf#csrf-excluding-uris) so it will not fail.
4. Make sure you add your webhook in Mandrill to point to your route. You can do this here:

(Optional) Webhook Authentication
---------------------------------

[](#optional-webhook-authentication)

If you would like to increase the security of the webhooks. Add the *MandrillWebhookServiceProvider* provider to the providers array in config/app.php

```
'providers' => [
  ...
  EventHomes\Api\Webhooks\MandrillWebhookServiceProvider::class,
],
```

Next, publish the configuration via

```
php artisan vendor:publish --provider="EventHomes\Api\Webhooks\MandrillWebhookServiceProvider"
```

Simply add your Mandrill webhook key in the config file and requests will be authenticated.

Webhook Events
--------------

[](#webhook-events)

[Webhook event types](https://mandrill.zendesk.com/hc/en-us/articles/205583217-Introduction-to-Webhooks#event-types):

Event typeMethodDescriptionSenthandleSend()message has been sent successfullyBouncedhandleHardBounce()message has hard bouncedOpenedhadleOpen()recipient opened a message; will only occur when open tracking is enabledMarked As SpamhandleSpam()recipient marked a message as spamRejectedhandleReject()message was rejectedDelayedhandleDeferral()message has been sent, but the receiving server has indicated mail is being delivered too quickly and Mandrill should slow down sending temporarilySoft-BouncedhandleSoftBounce()message has soft bouncedClickedhandleClick()recipient clicked a link in a message; will only occur when click tracking is enabledRecipient UnsubscribeshandleUnsub()recipient unsubscribesRejection Blacklist ChangeshandleBlacklist()triggered when a Rejection Blacklist entry is added, changed, or removedRejection Whitelist ChangeshandleWhitelist()triggered when a Rejection Whitelist entry is added or removedContributors
------------

[](#contributors)

Special thanks to @rafaelbeckel and @minioak!

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 87% 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 ~337 days

Recently: every ~385 days

Total

6

Last Release

2313d ago

Major Versions

v1.1 → v2.02020-03-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/78cbbdc5243e8c50348ff5c1e4c483b97e8b231cd24bf03a114a23fc61896fc7?d=identicon)[lostincode](/maintainers/lostincode)

---

Top Contributors

[![lostincode](https://avatars.githubusercontent.com/u/565885?v=4)](https://github.com/lostincode "lostincode (47 commits)")[![jeroenlammerts](https://avatars.githubusercontent.com/u/4282711?v=4)](https://github.com/jeroenlammerts "jeroenlammerts (2 commits)")[![rafaelbeckel](https://avatars.githubusercontent.com/u/28917?v=4)](https://github.com/rafaelbeckel "rafaelbeckel (2 commits)")[![avdb](https://avatars.githubusercontent.com/u/1193946?v=4)](https://github.com/avdb "avdb (1 commits)")[![ivantokar](https://avatars.githubusercontent.com/u/5750192?v=4)](https://github.com/ivantokar "ivantokar (1 commits)")[![mixisLv](https://avatars.githubusercontent.com/u/3735128?v=4)](https://github.com/mixisLv "mixisLv (1 commits)")

---

Tags

laravelmandrillphplaravelmaillumenwebhooksmandrill

### Embed Badge

![Health badge](/badges/eventhomes-laravel-mandrillhooks/health.svg)

```
[![Health](https://phpackages.com/badges/eventhomes-laravel-mandrillhooks/health.svg)](https://phpackages.com/packages/eventhomes-laravel-mandrillhooks)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k13](/packages/laravel-surveyor)

PHPackages © 2026

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