All Projects → oliveready7 → laravel-ses

oliveready7 / laravel-ses

Licence: other
A Laravel Package that allows you to get simple sending statistics for emails you send through SES, including deliveries, opens, bounces, complaints and link tracking

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to laravel-ses

vpc-peering-operator
A Kubernetes Operator to manage the lifecycle of AWS VPC Peering Connections
Stars: ✭ 23 (-41.03%)
Mutual labels:  amazon
mws-product
A module for retrieving product information via Amazon MWS API
Stars: ✭ 40 (+2.56%)
Mutual labels:  amazon
laravel-user-notifications
User notifications for Laravel 5+
Stars: ✭ 24 (-38.46%)
Mutual labels:  laravel-5-package
flash
An easy way for Laravel flash notifications.
Stars: ✭ 14 (-64.1%)
Mutual labels:  laravel-5-package
buildAPKsApps
Android APK app sources that build in Termux on Amazon Fire, Android and Chromebook! https://sdrausty.github.io/buildAPKsApps/
Stars: ✭ 32 (-17.95%)
Mutual labels:  amazon
amazon-auth-proxy
【PA-API v4のサポート終了にともない、このリポジトリは2020年3月に閉鎖されました】
Stars: ✭ 35 (-10.26%)
Mutual labels:  amazon
dailycodingproblem
Solutions to Daily Coding Problem questions
Stars: ✭ 26 (-33.33%)
Mutual labels:  amazon
LARAVEL-PDF-VIEWER
A Laravel Package for viewing PDF files or documents on the web without leaving your Web Application
Stars: ✭ 80 (+105.13%)
Mutual labels:  laravel-5-package
aws
Object Pascal implementation for Amazon S3
Stars: ✭ 67 (+71.79%)
Mutual labels:  amazon
selling-partner-sdk
Amazon Selling Partner JAVA SDK SP API
Stars: ✭ 15 (-61.54%)
Mutual labels:  amazon
django-eb-sqs-worker
Django Background Tasks for Amazon Elastic Beanstalk
Stars: ✭ 27 (-30.77%)
Mutual labels:  amazon
Amazon-Flipkart-Price-Comparison-Engine
Compares price of the product entered by the user from e-commerce sites Amazon and Flipkart 💰 📊
Stars: ✭ 41 (+5.13%)
Mutual labels:  amazon
no-amazon
Completely block Amazon and its services
Stars: ✭ 42 (+7.69%)
Mutual labels:  amazon
laravel-two-factor-authentication
A two-factor authentication package for Laravel >= 8
Stars: ✭ 37 (-5.13%)
Mutual labels:  laravel-5-package
laravel-form-builder
laravel专用表单生成器,快速生成现代化的form表单。包含复选框、单选框、输入框、下拉选择框等元素以及,省市区三级联动,时间选择,日期选择,颜色选择,树型,文件/图片上传等功能。
Stars: ✭ 59 (+51.28%)
Mutual labels:  laravel-5-package
laravel-hijri-dates
Hijri dates for Laravel
Stars: ✭ 25 (-35.9%)
Mutual labels:  laravel-5-package
Laravel-pushover
A Laravel wrapper for Pushover. Pushover makes it easy to get real-time notifications on your Android, iPhone, iPad, and Desktop (Pebble, Android Wear, and Apple watches, too!)
Stars: ✭ 49 (+25.64%)
Mutual labels:  laravel-5-package
voyager-portfolio
A Portfolio Module for Laravel Voyager 💋
Stars: ✭ 15 (-61.54%)
Mutual labels:  laravel-5-package
laravel-zend-acl
Adds ACL to Laravel via Zend\Permissions\Acl component.
Stars: ✭ 41 (+5.13%)
Mutual labels:  laravel-5-package
laravel-dynamodb-session-driver
DynamoDB Session Driver for Laravel 5
Stars: ✭ 15 (-61.54%)
Mutual labels:  laravel-5-package

laravel-ses

A Laravel 5.5+ Package that allows you to get simple sending statistics for emails you send through SES, including deliveries, opens, bounces, complaints and link tracking.

Install via composer

Add to composer.json

composer require oliveready7/laravel-ses

Make sure your app/config/services.php has SES values set

'ses' => [
    'key' => your_ses_key,
    'secret' => your_ses_secret,
    'domain' => your_ses_domain,
    'region' => your_ses_region,
],

Important to note that if you're using an IAM, it needs access to SNS (for deliveries, bounces and complaints) as well as SES

Make sure your mail driver located in app/config/mail.php is set to 'ses'

Publish public assets

php artisan vendor:publish --tag=public --force

Migrate the package's database tables

php artisan migrate

Optionally you can publish the package's config (laravelses.php)

php artisan vendor:publish --tag=config

Config Options

  • aws_sns_validator - whether the package uses AWS's SNS validator for inbound SNS requests. Default = false

Run command in production to setup Amazon email notifications to track bounces, complaints and deliveries. Make sure in your configuration your app URL is set correctly.

If your application uses the http protocol instead of https add the --http flag to this command

php artisan setup:sns

Usage

To send an email with all tracking enabled

SesMail::enableAllTracking()
    ->to('[email protected]')
    ->send(new Mailable);

All tracking allows you to track opens, bounces, deliveries, complaints and links

You can, of course, disable and enable all the tracking options

SesMail::disableAllTracking();
SesMail::disableOpenTracking();
SesMail::disableLinkTracking();
SesMail::disableBounceTracking();
SesMail::disableComplaintTracking();
SesMail::disableDeliveryTracking();


SesMail::enableAllTracking();
SesMail::enableOpenTracking();
SesMail::enableLinkTracking();
SesMail::enableBounceTracking();
SesMail::enableComplaintTracking();
SesMail::enableDeliveryTracking();

The batching option gives you the chance to group emails, so you can get the results for a specific group

SesMail::enableAllTracking()
    ->setBatch('welcome_emails')
    ->to('[email protected]')
    ->send(new Mailable);

You can manipulate the results manually by querying the database. Or you can use functions that come with the package.

SesMail::statsForBatch('welcome_emails');

//example result
[
    "send_count" => 8,
    "deliveries" => 7,
    "opens" => 4,
    "bounces" => 1,
    "complaints" => 2,
    "click_throughs" => 3,
    "link_popularity" => collect([
        "https://welcome.page" => [
            "clicks" => 3
        ],
        "https://facebook.com/brand" => [
            "clicks" => 1
        ]
    ])
]

Send count = number of emails that were attempted

Deliveries = number of emails that were delivered

Opens = number of emails that were opened

Complaints = number of people that put email into spam

Click throughs = number of people that clicked at least one link in your email

Link Popularity = number of unique clicks on each link in the email, ordered by the most clicked.

API INFO

Data always has the 'success' key indicating whether the request was successful or not

400 bad request = validation for the endpoint failed

404 = something in your query was not found

422 = any other error that might have occurred

GET /laravel-ses/api/has/bounced/{email}

Parameters - none

Response

    {
        "success": "true",
        "bounced": "true",
        "bounces": [
            {
                "message_id":"7a",
                "sent_email_id": "1",
                "type": "Permanent",
                "email": "[email protected]",
                "bounced_at": "2018-01-01 12:00:00"
            }
        ]
    }

GET /laravel-ses/api/has/complained/{email}

Parameters - none

Response

    {
        "success": "true",
        "complained": "true",
        "complaints": [
            {
                "message_id":"8b",
                "sent_email_id": "23",
                "type": "abuse",
                "email": "[email protected]",
                "complained_at": "2018-01-02 09:12:00"
            }
        ]
    }

GET /laravel-ses/api/stats/batch/{batchName}

Parameters - none

Response

    {
        "success": "true",
        "data": {
            "success":true,
            "data": {
                "send_count":0,
                "deliveries":0,
                "opens":0,
                "bounces":0,
                "complaints":0,
                "click_throughs":0,
                "link_popularity":[]
            }
        }
    }

GET /laravel-ses/api/stats/email/{email}

Parameters - none

Response

{
"success": true,
"data": {
    "counts": {
        "sent_emails": 3,
        "deliveries": 2,
        "opens": 1,
        "bounces": 1,
        "complaints": 1,
        "click_throughs": 2
    },
    "data": {
        "sent_emails": [
            {
                "id": 1,
                "message_id": "[email protected]",
                "email": "[email protected]",
                "batch": "welcome_emails",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            },
            {
                "id": 9,
                "message_id": "[email protected]",
                "email": "[email protected]",
                "batch": "win_back",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            },
            {
                "id": 10,
                "message_id": "[email protected]",
                "email": "[email protected]",
                "batch": "june_newsletter",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": null,
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            }
        ],
        "deliveries": [
            {
                "id": 1,
                "message_id": "[email protected]",
                "email": "[email protected]",
                "batch": "welcome_emails",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            },
            {
                "id": 9,
                "message_id": "[email protected]",
                "email": "[email protected]",
                "batch": "win_back",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            }
        ],
        "opens": [
            {
                "id": 1,
                "sent_email_id": "1",
                "email": "[email protected]",
                "batch": "welcome_emails",
                "beacon_identifier": "bfd935de-2219-4f86-9bd3-24afd06cc37a",
                "url": "https://laravel-ses.com/laravel-ses/beacon/bfd935de-2219-4f86-9bd3-24afd06cc37a",
                "opened_at": "2018-03-18 10:28:26",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            }
        ],
        "bounces": [
            {
                "id": 3,
                "message_id": "[email protected]",
                "sent_email_id": "9",
                "type": "abuse",
                "email": "[email protected]",
                "complained_at": "2017-08-25 07:58:39",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            }
        ],
        "complaints": [
            {
                "id": 3,
                "message_id": "[email protected]",
                "sent_email_id": "9",
                "type": "abuse",
                "email": "[email protected]",
                "complained_at": "2017-08-25 07:58:39",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26"
            }
        ],
        "click_throughs": [
            {
                "id": 1,
                "link_identifier": "0f14e25d-4712-4a9a-be6b-b190dc1a31b3",
                "sent_email_id": "1",
                "original_url": "https://google.com",
                "batch": "welcome_emails",
                "clicked": "1",
                "click_count": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26",
                "message_id": "[email protected]",
                "email": "[email protected]",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1"
            },
            {
                "id": 1,
                "link_identifier": "c7933d15-8e22-41e7-9074-e327ee02cf1a",
                "sent_email_id": "1",
                "original_url": "https://superficial.io",
                "batch": "welcome_emails",
                "clicked": "1",
                "click_count": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26",
                "message_id": "[email protected]",
                "email": "[email protected]",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1"
            },
            {
                "id": 9,
                "link_identifier": "be2d0bc9-87b7-48cc-8b57-6b714bfc9d48",
                "sent_email_id": "9",
                "original_url": "https://google.com",
                "batch": "win_back",
                "clicked": "1",
                "click_count": "1",
                "created_at": "2018-03-18 10:28:26",
                "updated_at": "2018-03-18 10:28:26",
                "message_id": "[email protected]",
                "email": "[email protected]",
                "sent_at": "2018-03-18 10:28:26",
                "delivered_at": "2017-08-25 07:58:40",
                "complaint_tracking": "1",
                "delivery_tracking": "1",
                "bounce_tracking": "1"
            }
        ]
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].