archintel-dev / ses-companion
laravel-ses 伴侣,用于创建群组、向群组添加订阅者、向群组订阅者发送邮件。
dev-master
2019-11-01 09:55 UTC
Requires
- laravelcollective/html: ^6.0
- maatwebsite/excel: ^3.1
- ramsey/uuid: ^3.8
This package is auto-updated.
Last update: 2024-09-29 05:29:35 UTC
README
laravel-ses 伴侣,用于创建群组、向群组添加订阅者、向群组订阅者发送邮件。
通过 composer 安装
composer require archintel-dev/ses-companion
在终端运行此命令
php artisan vendor:publish
您可以在资源文件夹中找到的包中美化在 js/ArchintelDev/SesCompanion/ 创建的 vue 模板
将资源添加到您的 app.js 文件中
require('./ArchintelDev/SesCompanion/app');
运行此命令 npm run dev
要使用创建的仪表板,重定向到路由 dashboard
用法
要发送所有跟踪都启用的邮件
SesMail::enableAllTracking()->to('hello@example.com')->send(new Mailable);
要发送所有跟踪都启用的邮件并将数据设置到特定账户,您可以在 setAccount() 中添加,其值为 client_uuid
SesMail::enableAllTracking()->setAccount('client_uuid')->to('hello@example.com')->send(new Mailable);
要批量发送所有跟踪都启用的邮件,只需添加 setBatch(),其值为 group_slug,不要移除 setAccout(),因为它位于账户下
SesMail::enableAllTracking()->setAccount('client_uuid')->setBatch('group_slug')->to('hello@example.com')->send(new Mailable);
要测试,您可以通过此 URL 发送邮件
/send-sample-mail/{type}/{account}/{account_id}/{group?}
其中
type = 'account' 或 'group' ,
account = client_slug ,
account_id = client_uuid 和
group 可以是 null,如果您想批量发送,可以将其设置为 group_slug
GET /{account}/{group}/api/stats/email/{email}
响应
{
"success": true,
"data": {
"account": {
"id": 1,
"email": "support@account.com",
"name": "Account",
"slug": "account",
"client_uuid": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"created_at": "2019-10-25 03:19:01",
"updated_at": "2019-10-25 03:19:37"
},
"group": [
{
"id": 1,
"name": "Group",
"slug": "group",
"client_id": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"created_at": "2019-10-25 03:23:02",
"updated_at": "2019-10-25 03:23:02"
}
],
"counts": {
"sent_emails": 1,
"deliveries": 1,
"opens": 1,
"bounces": 0,
"complaints": 0,
"click_throughs": 0
},
"data": {
"sent_emails": [
{
"id": 1,
"message_id": "761ff93f2f32f554072d01bda1a06d04@192.168.0.73",
"email": "email@sample.com",
"client_id": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"batch": "group",
"sent_at": "2019-10-25 03:29:34",
"delivered_at": null,
"complaint_tracking": 1,
"delivery_tracking": 1,
"bounce_tracking": 1,
"created_at": "2019-10-25 03:29:34",
"updated_at": "2019-10-25 03:29:34"
},
{
"id": 2,
"message_id": "b30713638ea10ab8437b28b98c342f33@192.168.0.73",
"email": "email@sample.com",
"client_id": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"batch": "group",
"sent_at": "2019-10-25 03:33:21",
"delivered_at": "2019-10-25 03:33:24",
"complaint_tracking": 1,
"delivery_tracking": 1,
"bounce_tracking": 1,
"created_at": "2019-10-25 03:33:21",
"updated_at": "2019-10-25 03:33:26"
}
],
"deliveries": [
{
"id": 2,
"message_id": "b30713638ea10ab8437b28b98c342f33@192.168.0.73",
"email": "email@sample.com",
"client_id": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"batch": "group",
"sent_at": "2019-10-25 03:33:21",
"delivered_at": "2019-10-25 03:33:24",
"complaint_tracking": 1,
"delivery_tracking": 1,
"bounce_tracking": 1,
"created_at": "2019-10-25 03:33:21",
"updated_at": "2019-10-25 03:33:26"
}
],
"opens": [
{
"id": 2,
"sent_email_id": 2,
"email": "email@sample.com",
"batch": "group",
"beacon_identifier": "37d85226-8253-47a4-bfe9-d2cf5050b824",
"url": "http://93722b3e.ngrok.io/sr/beacon/37d85226-8253-47a4-bfe9-d2cf5050b824",
"client_id": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"opened_at": "2019-10-25 03:39:03",
"created_at": "2019-10-25 03:33:21",
"updated_at": "2019-10-25 03:39:03"
}
],
"bounces": [
],
"complaints": [
],
"click_throughs": [
]
}
}
}
GET /{account}/{group}/api/stats/batch/{name}
响应
{
"success": true,
"data": {
"client": [
{
"id": 1,
"email": "account@sample.com",
"name": "Account",
"slug": "account",
"client_uuid": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"created_at": "2019-10-25 03:19:01",
"updated_at": "2019-10-25 03:19:37"
}
],
"group": [
{
"id": 1,
"name": "Group",
"slug": "group",
"client_id": "30c9a55c-f6d6-11e9-b8cb-f894c26e1fcc",
"created_at": "2019-10-25 03:23:02",
"updated_at": "2019-10-25 03:23:02"
}
],
"send_count": 3,
"deliveries": 2,
"opens": 1,
"bounces": 0,
"complaints": 0,
"click_throughs": 0,
"link_popularity": [
]
}
}
GET /{account}/{group}/api/has/complained/{email}
响应
{
}
GET /{account}/{group}/api/has/bounced/{email}
响应
{
}