olenchenko-a/laravel-sendpulse-mail 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

olenchenko-a/laravel-sendpulse-mail

Composer 安装命令:

composer require olenchenko-a/laravel-sendpulse-mail

包简介

Laravel package for Sendpulse mail transport

README 文档

README

Laravel mail transport based on https://github.com/sendpulse/sendpulse-rest-api-php library

Installation:

    composer require olenchenko-a/laravel-sendpulse-mail

Configuration:

In the config config/mail.php add a new transport:

return [
    //...
    'mailers' => [
        //...
        'sendpulse' => [
            'transport' => 'sendpulse',
            'api_user_id' => env('SPAPI_USER_ID'),
            'api_secret' => env('SPAPI_SECRET'),
        ],
    ]
]

Register the Service Provider

In config/app.php to providers section add

LaravelSendpulseMail\SendpulseMailServiceProvider::class,

In config/services.php add

'send_pulse' => [
        'api_user_id' => env('SPAPI_USER_ID'),
        'api_secret' => env('SPAPI_SECRET'),
    ],

Add to your .env

MAIL_MAILER=sendpulse

And provide your sendpulse credentials

SPAPI_USER_ID="YOUR_USER_ID"
SPAPI_SECRET="YOUR_SECRET"

Package also provide EmailSend event which contain the result of the operation sending email. You can use it for additional validating email sending result

    public function handle(EmailSend $event): void
    {
        if($event->result) {
            dispatch(function () use ($event) {
                $data = $this->client->get('smtp/emails/' . $event->emailId);

                if($data['smtp_answer_code'] != 250) {
                    // Despite email was successfuly sent to Sendpulse,
                    // it was not delivered to recepient
                }
            })->delay(now()->addMinutes(3));
        }
    }

统计信息

  • 总下载量: 172
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-25