io-digital / laravel-sendgrid-driver
此包已被废弃且不再维护。未建议替代包。
Laravel邮件配置的SendGrid驱动程序
1.0.1
2017-12-12 13:01 UTC
Requires
- guzzlehttp/guzzle: ~5.1
- illuminate/mail: ~5.1
Requires (Dev)
- illuminate/container: ~5.1.0
- illuminate/filesystem: ~5.1.0
- phpunit/phpunit: >=4.0
This package is not auto-updated.
Last update: 2021-05-15 00:54:33 UTC
README
一个支持Sendgrid Web API的邮件驱动程序,使用原始的Laravel API。此库扩展了原始的Laravel类,因此使用完全相同的方法。
使用此包需要Sendgrid API密钥,可以在以下链接中生成:这里。
安装
将包添加到您的composer.json
文件,并运行composer update
"require": { "io-digital/laravel-sendgrid-driver": "^1.0" },
或者,直接使用composer安装
$ composer require io-digital/laravel-sendgrid-driver
在app/config/app.php
中移除默认的服务提供器,并添加sendgrid服务提供器
'providers' => [ // Illuminate\Mail\MailServiceProvider::class, IoDigital\SendGridDriver\MailServiceProvider::class, ];
配置
编辑您的.env
文件,包括以下内容
MAIL_DRIVER=sendgrid
SENDGRID_API_KEY='YOUR_SENDGRID_API_KEY'
最后,编辑您的config/service.php
文件,包括以下内容
'sendgrid' => [ 'api_key' => env('SENDGRID_API_KEY') ]