davidneal/laravel-ses-tracker
Composer 安装命令:
composer require davidneal/laravel-ses-tracker
包简介
Allows you to track opens, deliveries, bounces, complaints and clicked links when sending emails through Laravel and Amazon SES
README 文档
README
A Laravel 6.0+ Package that allows you to get simple sending statistics for emails you send through SES, including deliveries, opens, bounces, complaints and link tracking.
This is a revamped version of oliveready7/laravel-ses package, updated to support Laravel v6.0+ and some bug fixes. Primarily I revamped this package so it's suitable to be used in my company project with Laravel v6.0+.
Here are the differences between original package and this package:
- All the namespace are changed to
DavidNeal/LaravelSesTracker - Service provider is now
LaravelSesTrackerServiceProvider - All the tables name are prefixed with
laravel_ses_trackerinstead oflaravel_ses - New unsubscribe column in
sent_emails(TODO) - Config file is now
config/laravel-ses-tracker.phpinstead ofconfig/laravelses.php - Routes are unchanged, they are still prefixed with
/laravel-ses
Apart from the above listed differences, there are not much more difference between this package and oliveready7's package.
Install via composer
Add to composer.json
composer require davidneal/laravel-ses-tracker
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 (laravel-ses-tracker.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('hello@example.com')
->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 setEmailId option gives you the chance to group emails via a foreign id, so you can get the results for a specific email of your own.
SesMail::enableAllTracking()
->setEmailId($email->id)
->to('hello@example.com')
->send(new Mailable);
You can manipulate the results manually by querying the database. Or you can use functions that come with the package.
SesMail::statsForEmail('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.
davidneal/laravel-ses-tracker 适用场景与选型建议
davidneal/laravel-ses-tracker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「amazon」 「email」 「laravel」 「ses」 「email marketing」 「Amazon Simple Email Service」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 davidneal/laravel-ses-tracker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 davidneal/laravel-ses-tracker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 davidneal/laravel-ses-tracker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This package includes a script and fail2ban configuration that allows you to use fail2ban when utilizing AWS elastic load balancer (ELB) and an apache webserver.
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
A simple Laravel 5/6/7/8 service provider for including the AWS SDK for PHP.
Laravel contact us form package to send email and save to database
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-25