mprince / mailstation
为Laravel提供的邮件集成
dev-main
2021-08-12 05:49 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- phpunit/phpunit: ~4.1
This package is auto-updated.
Last update: 2024-09-12 12:28:45 UTC
README
#MailHub
语言: 中文
MailHub 是一个针对 Laravel 的电子邮件包。
它将第三方电子邮件服务与 Laravel 的 SwiftMail 集成,为电子邮件流程提供统一的协议。通过规则引擎,按照相应的发送者将邮件发送到不同的域名。
- 提供优雅的电子邮件界面,替代 SwiftMail
- 连接到 SwiftMail 以外的第三方电子邮件服务
- 目前实现通过 SendCloud 发送电子邮件
- 计划在下一个版本中实现标签和队列
- 欢迎讨论和PR
##如何安装
# The introduction of dependent libraries
composer require mrvokia/mailhub:"dev-master@dev" -vvv
# Added service provider in the providers
MrVokia\MailHub\MailHubServiceProvider::class
# Add the aliases facade
'MailHub' => MrVokia\MailHub\MailHubFacade::class
# Composer auto load
composer dump
# Push Profile mailhub
php artisan vendor:publish
##如何使用
use MrVokia\MailHub\MailHub; /** * Send mail */ public function example(MailHub $mailhub) { $mailhub->send() ->to(['1@test.com', '2@test.com']) ->cc(['3@test.com']) ->subject('example') ->html('example content') ->start() //or MailHub::send() ->to(['1@test.com', '2@test.com']) ->cc(['3@test.com']) ->subject('example') ->html('example content') ->start() } /** * Send template mail */ public function exampleTemplate(MailHub $mailhub) { $mailhub->send() ->to(['1@test.com', '2@test.com']) ->subject('example') ->xsmtpapi([ 'active' => ['test', 'test2'] ]) ->templateInvokeName('mail.register') ->start() //or MailHub::send() ->to(['1@test.com', '2@test.com']) ->cc(['3@test.com']) ->subject('example') ->xsmtpapi([ 'active' => ['test', 'test2'] ]) ->templateInvokeName('mail.register') ->start() }
##参数:
##感谢