shivas / bouncer-bundle
Symfony2 bundle for AWS SES/SNS Bounce topic listener and swiftmailer filter
Installs: 1 828
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 3
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.4.0
- aws/aws-sdk-php: ~2.7
- symfony/framework-bundle: ~2.5
- symfony/swiftmailer-bundle: ~2.3
Requires (Dev)
- doctrine/common: ~2.4
- phpunit/phpunit: ~4.5
- symfony/console: ~2.5
- symfony/yaml: ~2.5
This package is auto-updated.
Last update: 2024-11-05 22:41:21 UTC
README
Symfony2 bundle to automate AWS SES users using swiftmailer to filter out bouncing email recipients inside project.
AWS SES users know, if you get big amount of Bouncing emails, AWS will send you into probation period. In some cases, there is no easy way to solve issue. This bundle solves problem transparently filtering recipients lists trough own database built by listening on AWS SNS Bounce topic that it creates and hooks to your identity.
Requirements:
- You use AWS SES to send your emails
- You have AWS API key
- You have confirmed email identity (email or whole domain)
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require shivas/bouncer-bundle "~0.1"
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Shivas\BouncerBundle\ShivasBouncerBundle(), ); // ... } // ... }
Step 3: Add configuration
# Default configuration for "ShivasBouncerBundle" shivas_bouncer: db_driver: orm # currently only ORM supported model_manager_name: null # if using custom ORM model manager, provide name, otherwise leave as null aws_api_key: key: ~ # Required, your AWS API KEY secret: ~ # Required, your AWS API SECRET region: us-east-1 # Required, region of AWS to use bounce_endpoint: route_name: _shivasbouncerbundle_bounce_endpoint protocol: HTTP # HTTP or HTTPS host: localhost.local # hostname of your project when in production filter: enabled: true # if false, no filtering of bounced recipients will happen filter_not_permanent: false # if false, all temporary bounces will not make that address to be filtered forever mailer_name: # array of mailer names where to register filtering plugin - default
Add routing file for bounce endpoint (feel free to edit prefix)
# app/config/routing.yml bouncer: resource: @ShivasBouncerBundle/Resources/config/routing.yml prefix: /aws/endpoints
Step 4: Update your database schema
$ php app/console doctrine:schema:update --force
Step 5: Setup subscription to Bounce topic
Run in console:
./app/console swiftmailer:sns:setup-bounce-topic Bounce
This will use your AWS keys to fetch available identities, and provide you option to choose what identities to subscribe to. "Bounce" in console is name of topic to setup (Naming rules should follow AWS naming rules for topics)
What will happen:
- Bounce topic will be created
- All chosen identities will be configured to send Bounce notifications to that topic
- Your project url will be provided as HTTP or HTTPS (configuration) endpoint for AWS
- Automatic subscription confirmation will occur on AWS request to confirm (if your endpoint is reachable)
Contribute
Contribute trough issues or pull request.
Todo
Mapping for MongoDB and other supported databases by Doctrine