PHPackages                             mehr-it/lara-ses-ext - 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. mehr-it/lara-ses-ext

ActiveLibrary

mehr-it/lara-ses-ext
====================

Extended AWS SES mail transport driver and SES notification handling

2.0.0(5y ago)0141MITPHPPHP &gt;=7.1.0CI failing

Since Feb 3Pushed 5y agoCompare

[ Source](https://github.com/mehr-it/lara-ses-ext)[ Packagist](https://packagist.org/packages/mehr-it/lara-ses-ext)[ RSS](/packages/mehr-it-lara-ses-ext/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (10)Used By (0)

lara-ses-ext
============

[](#lara-ses-ext)

[![Latest Version on Packagist](https://camo.githubusercontent.com/034d64030643b1bc7d537916e48ff83de1605967261fc12fdb8552315df50e57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6568722d69742f6c6172612d7365732d6578742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mehr-it/lara-ses-ext)[![Build Status](https://camo.githubusercontent.com/3e650f5d9018071fd479557a7fc032a46f2a220e7b6f62fdbded200ff9375e10/68747470733a2f2f7472617669732d63692e6f72672f6d6568722d69742f6c6172612d7365732d6578742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mehr-it/lara-ses-ext)

This package implements an extended driver for sending mails via AWS SES in Laravel. It dispatches a custom event on dispatch containing an exact copy of the passed message for archiving purposes.

Additionally a helper exists which transforms status notifications published by SES to Laravel events.

Install
-------

[](#install)

```
composer require mehr-it/lara-ses-ext

```

This package uses Laravel's package auto-discovery, so the service provider will be loaded automatically.

Mailer configuration
--------------------

[](#mailer-configuration)

Set the transport option of your mailer in `config/mail.php` configuration file to `"ses-ext"`:

```
'mailers' => [
    'ses' => [
        'transport' => 'ses-ext',
    ]
]

```

Verify that your `config/services.php` configuration file contains the following options:

```
'ses' => [
    'key'    => 'your-ses-key',
    'secret' => 'your-ses-secret',
    'region' => 'ses-region',  // e.g. us-east-1
],

```

Dispatched event
----------------

[](#dispatched-event)

The `SesMessageDispatched` event is dispatched by the driver right after the message has been passed to SES. It contains the message id assigned by SES and a copy of the raw message data which has been passed.

You can use this information to a archive an exact copy of each sent message.

### Adding custom information

[](#adding-custom-information)

Sometimes it might be helpful to have additional information about the sent message, when receiving the dispatched event. For example if the user ID of the recipient should be stored to the mail archive.

With the `ses-ext` driver, this can be achieved by using the `InternalMailHeaders` trait in mailables and invoking the `withInternalHeader` method from within the `build` function:

```
use InternalMailHeaders;

/**
 * Build the message.
 *
 * @return $this
 */
public function build()
{
    $this->view('emails.orders.shipped');

    $this->withInternalHeader('user-id', $userId);
}

```

The internal headers are not sent to SES, but are removed right before sending the message.

When handling the `SesMessageDispatched` event, it is simple to retrieve the internal header values again:

```
$userId = $event->getInternalHeaderValue('user-id');

```

SES notifications
-----------------

[](#ses-notifications)

AWS SES offers notifications to monitor the sending activity. A notification can be received for bounces, complaints and deliveries. To receive notifications, SES has to be configured to sent them to an SNS topic. SNS then can pass the notifications to your application, eg. via webhook or a SQS queue. For further information, see the [AWS SES documentation](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity-using-notifications.html).

The receiving of SNS notifications is not in the scope of this library, but the `SesNotificationHandler` class helps to convert received SES notifications into Laravel events. Therefore the raw JSON notification string has to be passed to the handle method:

```
$handler = app(SesNotificationHandler::class);

$handler->handle('{"notificationType":"Delivery", "mail":{ ...} }');

```

The handle method parses the JSON and emits the corresponding event using the application event dispatcher. One of the following events is dispatched based on the notification type:

- `SesMessageDelivered` - when a message has been delivered
- `SesMessageComplained` - when a complaint has been received
- `SesMessageBounced` - when a bounce has happened

The events' getters provide access to all notification information given by SES.

Test driver
-----------

[](#test-driver)

When testing your application with other mail drivers, such as array drivers, the `SesMessageDispatched`event is not emitted. If tests rely on that events, the `"ses-ext-simulation"` driver can be used. It behaves exactly like the `"ses-ext"` driver but does not invoke the SES API. Instead a random message id is generated and returned.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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 ~38 days

Recently: every ~76 days

Total

9

Last Release

1980d ago

Major Versions

1.4.1 → 2.0.02020-12-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44973729?v=4)[mehr.IT GmbH](/maintainers/mehr-it)[@mehr-it](https://github.com/mehr-it)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mehr-it-lara-ses-ext/health.svg)

```
[![Health](https://phpackages.com/badges/mehr-it-lara-ses-ext/health.svg)](https://phpackages.com/packages/mehr-it-lara-ses-ext)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)

PHPackages © 2026

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