PHPackages                             stechstudio/laravel-email-events - 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. stechstudio/laravel-email-events

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

stechstudio/laravel-email-events
================================

Handle email event webhooks

0.10(1y ago)16.6k1MITPHP

Since Dec 24Pushed 1y ago4 watchersCompare

[ Source](https://github.com/stechstudio/laravel-email-events)[ Packagist](https://packagist.org/packages/stechstudio/laravel-email-events)[ Docs](https://github.com/stechstudio/laravel-email-events)[ RSS](/packages/stechstudio-laravel-email-events/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (10)Used By (0)

Email event webhook processing
==============================

[](#email-event-webhook-processing)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9fb4555cebca4e4c1663220269cdae66361110e07c79d63ab7e337d99d075878/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737465636873747564696f2f6c61726176656c2d656d61696c2d6576656e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stechstudio/laravel-email-events)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

So you have your Laravel app sending email out through SendGrid or Mailgun or Postmark, super. Now you want to capture webhooks and react to email events, such as deliveries or bounces. This is where it can get a bit messy, authorizing the webhook submission, parsing the payload, handling the details... and then of course you've tied yourself to one particular email provider.

This package greatly simplifies the process. It will accept webhook submissions from any supported email provider, authorize the submission, generalize it to a standard data format, and fire off a Laravel event. Now all you have to do is listen for an event and go!

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

[](#installation)

Via Composer

```
$ composer require stechstudio/laravel-email-events
```

Quick start
-----------

[](#quick-start)

### 1. Add the routes

[](#1-add-the-routes)

In your `routes/web.php` file add:

```
EmailEvents::routes();
```

This will wire up a route at `.hooks/email-events/{provider}`.

### 2. Configure your auth method

[](#2-configure-your-auth-method)

There are multiple authorization options available. The default option (and works with any provider) is just a URL token.

In your app .env file set a token secret:

```
MAIL_EVENTS_AUTH_TOKEN=mysecrettoken

```

### 3. Configure your mail provider with your webhook endpoint

[](#3-configure-your-mail-provider-with-your-webhook-endpoint)

Log in to your email provider account, find the webhook section, and add your URL endpoint. Make sure to specify the provider name, and include the auth token.

For example, if you are using SendGrid you would go to the [Mail Settings](https://app.sendgrid.com/settings/mail_settings) page, turn on the "Event Notification" setting, check all the actions that you care about, and provide your POST URL:

```
https:///.hooks/email-events/sendgrid?auth=mysecrettoken

```

> Note while in local/development mode you can use [`valet share`](https://laravel.com/docs/master/valet#sharing-sites) to get a publicly accessible domain for your app.

### 4. Listen for the event

[](#4-listen-for-the-event)

Lastly, you need to listen for an email event in your app. Setup an [event listener](https://laravel.com/docs/master/events#defining-listeners) and listen for `STS\EmailEvents\EmailEvent`.

Something like this:

```
namespace App\Listeners;

use STS\EmailEvents\EmailEvent;

class NotifyBouncedEmail {

    public function handle(EmailEvent $event)
    {
        // I only care about bounces
        if($event->getAction() != EmailEvent::EVENT_BOUNCED) {
            return;
        }

        // Ok so we have an email bounce! Need to go handle that. Maybe notify us on Slack?
        // ...
    }

}
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance44

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.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 ~237 days

Recently: every ~278 days

Total

9

Last Release

435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/315be5f111b5501a41b99a0205c9c85915335391168a0ed10316546a1a38bbd8?d=identicon)[jszobody](/maintainers/jszobody)

---

Top Contributors

[![jszobody](https://avatars.githubusercontent.com/u/203749?v=4)](https://github.com/jszobody "jszobody (14 commits)")[![RPillz](https://avatars.githubusercontent.com/u/9386244?v=4)](https://github.com/RPillz "RPillz (1 commits)")

---

Tags

emaillaravelpostmarksendgridwebhookslaravelsendgridwebhookspostmarkEmail Events

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stechstudio-laravel-email-events/health.svg)

```
[![Health](https://phpackages.com/badges/stechstudio-laravel-email-events/health.svg)](https://phpackages.com/packages/stechstudio-laravel-email-events)
```

###  Alternatives

[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[coconutcraig/laravel-postmark

Laravel package for sending mail via the Postmark API

2152.9M1](/packages/coconutcraig-laravel-postmark)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[therobfonz/laravel-mandrill-driver

Mandrill Driver for Laravel

773.5M](/packages/therobfonz-laravel-mandrill-driver)

PHPackages © 2026

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