emotality/laravel-everlytic
Composer 安装命令:
composer require emotality/laravel-everlytic
包简介
Laravel package to send transactional SMSes and emails (mail driver) via Everlytic.
README 文档
README
Laravel package to send transactional SMSes and emails (mail driver) via Everlytic.
Minimum Requirements
- PHP 8.1
- Laravel 10
Installation
composer require emotality/laravel-everlyticphp artisan vendor:publish --provider="Emotality\Everlytic\EverlyticServiceProvider"- Add the following lines to your
.env:
EVERLYTIC_URL="https://<everlytic_domain>.everlytic.net"
EVERLYTIC_USERNAME="<everlytic_username>"
EVERLYTIC_PASSWORD="<everlytic_password>"
- Add the
everlyticblock to themailersarray, inside yourconfig/mail.phpfile:
'mailers' => [ ... 'everlytic' => [ 'transport' => 'everlytic', ], ],
- Update the
MAIL_MAILERin your.env:
MAIL_MAILER=everlytic
Usage
Sending an email:
Just send emails like you normally would! 😄
Sending an SMS to a single recipient:
\Everlytic::sms('+27820000001', "1st Line\n2nd Line\n3rd Line");
Response will be a bool, true if successful, false if unsuccessful.
Sending an SMS to multiple recipients:
\Everlytic::smsMany(['+27820000001', '+27820000002'], "1st Line\n2nd Line\n3rd Line");
Response will be an array where the keys are the recipients' numbers, the values will be booleans:
array:2 [▼ "+27820000001" => true "+27820000002" => false ]
Sending an email and/or SMS via notification:
namespace App\Notifications; use Emotality\Everlytic\EverlyticSms; use Emotality\Everlytic\EverlyticSmsChannel; use Illuminate\Notifications\Notification; class ExampleNotification extends Notification { // Notification channels public function via($notifiable) { return ['mail', EverlyticSmsChannel::class]; } // Send email public function toMail($notifiable) { return new \App\Mail\ExampleMail($notifiable); } // Send SMS public function toSms($notifiable) // Can also use toEverlytic($notifiable) { // Send SMS to a single recipient return (new EverlyticSms()) ->to($notifiable->mobile) // Assuming $user->mobile ->message("1st Line\n2nd Line\n3rd Line"); // or send SMS to multiple recipients return (new EverlyticSms()) ->toMany(['+27820000001', '+27820000002']) ->message("1st Line\n2nd Line\n3rd Line"); } }
License
laravel-everlytic is released under the MIT license. See LICENSE for details.
emotality/laravel-everlytic 适用场景与选型建议
emotality/laravel-everlytic 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 473 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 07 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「laravel」 「everlytic」 「emails」 「transactional sms」 「transactional emails」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 emotality/laravel-everlytic 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 emotality/laravel-everlytic 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 emotality/laravel-everlytic 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
Alfabank REST API integration
A fork of simplesoftwareio/simple-sms with Verimor driver.
Aakash Sms Provider Api Wrapper
统计信息
- 总下载量: 473
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-01