laravel-mailcoach-ses-feedback can handle bounce feedback coming from SES. All e-mail addresses that permanently bounce will be unsubscribed from all lists.
You can install the add-on package via composer:
composer require spatie/laravel-mailcoach-ses-feedback:^2.0
Adding the webhooks route
You must use this route macro in your route service provider. Do NOT apply the
web group middleware to this route as that would cause an unnecessary session to be started for each webhook call.
You can replace
ses-feedback with any url you'd like.
Configuring webhooks at Amazon SES
Simple Email Service Setup
- In your AWS Management Console, create a configuration set if you haven't already
- Add a SNS destination in the Event Destinations and make sure to check the event types you would like to receive
- Create a new topic for this destination
Simple Notification Service Setup
First, make sure your endpoint is accessible, if you're installing this locally you'll need to share your local environment using
valet share or a service like
- Create a subscription for the topic you just created, use
HTTPS as the Protocol
- Enter the endpoint you just created the route for
- Do not check "Enable raw message delivery", otherwise signature validation won't work
- In Delivery retry policy (HTTP/S) make sure to set a limit in the Maximum receive rate setting,
5 / second is a good default as that is the default php-fpm pool size.
- You can leave all other settings on their defaults
- Your subscription should be automatically confirmed if the endpoint was reachable
Setting the configuration name in your Laravel app
This package automatically adds the correct
X-Configuration-Set header for Amazon SES to process feedback. Make sure the name of your configuration set is available under the
mailcoach.ses_feedback.configuration_set configuration key.
Here's an example for a configuration set that is named
'ses_feedback' => [
'configuration_set' => 'mailcoach',
Using the correct mail driver
If you haven't done so already, you must configure Laravel to use the Amazon SES driver. Follow the instruction in the mail section of the Laravel docs.