3 Star 0 Fork 0

Gitee 极速下载 / Laravel-SendCloud

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/NauxLiu/Laravel-SendCloud
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Laravel-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('us@example.com', 'Laravel');

    $message->to('foo@example.com')->cc('bar@example.com');
});

模板方式发送

用法和普通发送类似,不过需要将 body 设置为 SendCloudTemplate 对象

注意:使用模板发送不与其他邮件驱动兼容

// 模板变量
$bind_data = ['url' => 'http://naux.me'];
$template = new SendCloudTemplate('模板名', $bind_data);

Mail::raw($template, function ($message) {
    $message->from('us@example.com', 'Laravel');

    $message->to('foo@example.com')->cc('bar@example.com');
});

空文件

简介

Laravel 5.1 的 SendCloud 驱动 普通发送方式完全兼容官方用法,可随时修改配置文件改为其他驱动,而不需要改动业务代码 安装 在项目目录下执行 compose 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mirrors/Laravel-SendCloud.git
git@gitee.com:mirrors/Laravel-SendCloud.git
mirrors
Laravel-SendCloud
Laravel-SendCloud
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891