프로젝트
GitHub에서 보기
nauxliu/Laravel-SendCloud
소개
适用于 Laravel 5.X 的 SendCloud 驱动
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalLaravel-SendCloud
供 Laravel 5.X 使用的 SendCloud 驱动,发送方式完全兼容官方用法,可随时修改配置文件改为其他驱动,而不需要改动业务代码
Laravel 5.5以下版本请使用1.1.3版本,并手动添加 ServiceProvier 到config/app.php
安装
composer require naux/sendcloud
配置
在 .env 中配置你的密钥, 并修改邮件驱动为 sendcloud
MAIL_DRIVER=sendcloud
SEND_CLOUD_USER= # 创建的 api_user
SEND_CLOUD_KEY= # 分配的 api_key
使用
普通方式发送:
用法完全和系统自带的一样, 具体请参照官方文档: http://laravel.com/docs/5.1/mail
Mail::send('emails.welcome', $data, function ($message) {
$message->from('[email protected]', 'Laravel');
$message->to('[email protected]')->cc('[email protected]');
});
模板方式发送
用法和普通发送类似,不过需要将 body 设置为 SendCloudTemplate 对象
注意:使用模板发送不与其他邮件驱动兼容
// 模板变量
$bind_data = ['url' => 'http://naux.me'];
$template = new SendCloudTemplate('模板名', $bind_data);
Mail::raw($template, function ($message) {
$message->from('[email protected]', 'Laravel');
$message->to('[email protected]')->cc('[email protected]');
});
관련 프로젝트 살펴보기
불러오는 중…