luchavez/aws-ses-bounce

Blacklisting bounced email addresses on AWS Simple Email Service (SES) for Laravel 8|9|10

1.0.3 2023-10-23 15:31 UTC

This package is auto-updated.

Last update: 2024-10-23 17:56:39 UTC


README

Latest Version on Packagist Total Downloads GitHub Repo stars Discord Twitter Follow

Using AWS Simple Email Service (SES) for sending emails and newsletters is very common in Laravel apps nowadays. AWS SES configurations for Laravel is easy to follow as well.

The problem now is the maintenance part of sending these emails. Sending emails to unverified addresses can cause bounces whereas sending too many emails can cause complaints. If these bounces and complaints are left unchecked, it may cause the reputation of the sender to be damaged.

According to this documentation, if the bounce or complaint rates are too high, AWS might place the account under review or pause the account's ability to send email.

The aim of this package, luchavez/aws-ses-bounce, is to monitor the email bounces, complaints, and successful deliveries. This package records the recipient email addresses and their bounces, complaints, and deliveries.

One cool feature of this package is the automatic blocking. When a set amount of bounces or complaints is reached, the email address causing that will be immediately blocked. Another cool feature would be the automatic removal of blocked email address from to, cc, and bcc recipients during email sending.

Here's the entity relationship diagram (ERD) of this package:

AWS SES Bounce ERD

Want to contribute? Visit contributing.md to see a todo list.

Installation

Via Composer

$ composer require luchavez/aws-ses-bounce:^1.0.0

Setting Up

  1. Run php artisan migrate to create the tables.

  2. Add these variables to .env file if you want to override the default values of the package's config.

Usage

AWS SES Bounce Service

The package provides a service called AwsSesBounce which you can use by calling its helper functions:

  1. awsSesBounce()
  2. aws_ses_bounce()

Here's the list of its available methods.

GenerateAwsSesBounceSignedURLCommand Artisan Command

To be able to receive AWS SES feedbacks via AWS SNS Topics, you must generate first the endpoints by running:

php artisan asb:generate

You'll be getting something like this:

AWS SES Bounce HTTP Endpoints

Submit these endpoints to assigned DevOps personnel so they can set it up on AWS Console.

Routes

AWS SES Bounce Route List

Note: If APP_ENV is equal to production, api/aws-ses/test and api/aws-ses/dump routes will be disabled.

Resources

Change log

Please see the changelog for more information on what has changed recently.

Testing

To send test emails, you can use the /api/aws-ses/test route. Add to, cc, and bcc recipients - can be array or just a single value.

AWS SES Bounce Send Test Email

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email jamescarloluchavez@gmail.com instead of using the issue tracker.

Credits

License

Please see the license file for more information.