PHPackages                             peopleperhour/yii-ses-feedback - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. peopleperhour/yii-ses-feedback

ActiveYii-extension[Mail &amp; Notifications](/categories/mail)

peopleperhour/yii-ses-feedback
==============================

Process SES feedback notifications so that your Yii app can react to Email Bounces and Complaints

37.7k2PHP

Since Jul 28Pushed 9y ago5 watchersCompare

[ Source](https://github.com/PeoplePerHour/yii-ses-feedback)[ Packagist](https://packagist.org/packages/peopleperhour/yii-ses-feedback)[ RSS](/packages/peopleperhour-yii-ses-feedback/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii-ses-feedback
================

[](#yii-ses-feedback)

Introduction
------------

[](#introduction)

Does your Yii application use Amazon [Simple Email Service (SES)](http://aws.amazon.com/ses/) for sending email? If so you can use this extension to process "feedback notifications" such as email bounces and email complaints.

- What do we mean by a "email bounce"? We mean a email delivery failure, for example, if an email address does not exist.
- What do we mean by a "email complaint"? We mean the recipient has indicated they do not what the email that you sent them, for example, by clicking "Mark as spam" in their email client. Amazon SES has feedback loops set up with certain major ISPs, and can automatically forward the complaint information to the sender.

Why do you need Yii-ses-feedback?
---------------------------------

[](#why-do-you-need-yii-ses-feedback)

- Cost: By using SES, you pay per message. To save money you need a feedback loop so you can know which emails are not being recieved, and stop sending them.
- Reputation: If your SES account racks up too many bounces or complaints, your reputation will decrease. Amazon might not let you increase your sending throughput for example.
- Workflow: You might want to deactivate users with invalid email addresses. For many apps, having a large number of dormant user accounts will we a performance problem.
- Stats: You might want to record bounce stats in your application database.

Requirements
------------

[](#requirements)

- Yii 1.\*
- You must be using Amazon [Simple Email Service](http://aws.amazon.com/ses/) (SES) to send email.
- You must configure Amazon SES Feedback Notifications via Amazon Simple Notification Service (SNS). This can be done via there web-console - here are [instructions](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/configure-sns-notifications.html).
- You must configure the SNS messages to integrate with Amazon Simple Queue Service (SQS) to ensure the feedback notifications are stored until our application can process them. Set up the following AWS components to handle bounce notifications:
    1. Create an Amazon SQS queue named `bounces_and_complaints`.
    2. Create an Amazon SNS topic named `bounces_and_complaints-topic`.
    3. Configure the new Amazon SNS topic to publish to the SQS queue.
    4. Configure Amazon SES to publish bounce notifications using `bounces_and_complaints-topic` to the `bounces_and_complaints` queue. Instead of a combined queue, you can choose to use two separate queues if you want.
- Yii-ses-feedback requires the [AWS SDK for PHP](https://github.com/aws/aws-sdk-php) to access the SQS API. SQS API access credentials will be needed when configuring Yii-ses-feedback.
- Yii-ses-feedback supports v2 or v3 of the API. v3 was released in 27/May/15 and is the default, if you need v2 then there is one extra line to add to the config, see below.

Features
--------

[](#features)

- Instead of parsing bounced emails ourselves to determine the cause, we can let Amazon SES do it for us. Amazon SES will categorize your hard bounces into two types: permanent and transient. A permanent bounce indicates that you should never send to that recipient again. A transient bounce indicates that the recipient's ISP is not accepting messages for that particular recipient at that time and you can retry delivery in the future. The amount of time you should wait before resending to the address that generated the transient bounce depends on the transient bounce type. Certain transient bounces require manual intervention before the message can be delivered (e.g., message too large or content error). If the bounce type is undetermined, you should manually review the bounce and act accordingly.
- Raise a Yii event whenever a Email bounce or complaint is found. It's up to you how you handle the event (an example is given).

Installation - Manual (The Old Fashion Way)
-------------------------------------------

[](#installation---manual-the-old-fashion-way)

Extract the package to your `extensions` folder into a directory called `yii-ses-feedback`.

Ensure the extension files will be autoloaded by adding a line to the Yii imports config section:

```
