jfunu/laravel-ses-manager

Logs SES bounces and complaints for Laravel app

Installs: 6 617

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 2

Type:package

dev-master 2024-01-01 16:31 UTC

This package is auto-updated.

Last update: 2024-04-30 17:17:21 UTC


README

Logs AWS Simple Email Service bounces and complaints for Laravel app

Setup

composer require Megaverse/laravel-ses-manager
php artisan migrate
  • Add the routes to your controller and off you go
// api.php
Route::post('/webhooks/ses/bounce', [Megaverse\LaravelSesManager\Controllers\SESWebhookController::class, 'bounce']);
Route::post('/webhooks/ses/complaint', [Megaverse\LaravelSesManager\Controllers\SESWebhookController::class, 'complaint']);
  • Map the hooks in your SES dashboard to the your application routes.

Usage

Use Megaverse\LaravelSesManager\Eloquent\BlackListItem is the model for blacklisted emails.

// check if email is blacklisted
$blackListItem = Megaverse\LaravelSesManager\Eloquent\BlackListItem::query()
  ->whereNotNull('blacklisted_at')
  ->where('email', $email)
  ->first();

// whitelist email while keeping it in the history
$blackListItem->delete();

// remove email and remove it from the history
$blackListItem->forceDelete();