notifea/notifea-php-nette
Composer 安装命令:
composer require notifea/notifea-php-nette
包简介
Nette wrapper for PHP language for Notifea services.
README 文档
README
Nette wrapper for PHP language for Notifea services.
Notifea provides clients very user-friendly way of sending transactional emails and sms to their users.
This package is a Nette wrapper for Notifea PHP package.
Minimum requirements
This package will require you to use:
- PHP 7.0 or higher
- guzzlehttp/guzzle 6.0 or higher
- ext-json
Installation
To install the SDK you need to be using Composer in your project. To install it please see the docs.
After you installed Composer install the SDK
composer require notifea/notifea-php-nette
Start by registering Notifea\Nette\DI\NotifeaExtension in your config neon file
extensions: notifea: Notifea\Nette\DI\NotifeaExtension
You are only required to set authorization config key. Value can be generated in
access-tokens section.
extensions: notifea: Notifea\Nette\DI\NotifeaExtension notifea: authorization: "Bearer {token}"
There are few more optional parameters you can specify.
extensions: notifea: Notifea\Nette\DI\NotifeaExtension notifea: api_host: "https://api.notifea.com/v1" authorization: "Bearer {token}" connect_timeout: 10 timeout: 30
Versions
This package currently supports:
- nette 2.4 using tag ^0.0.1
- nette 3.0 using tag ^1.0.0
To add support for other versions please get in touch with us.
Usage
This packages provides a convenient dependency injection layer
for Notifea\Services\EmailService, Notifea\Services\SmsService and Notifea\Services\SmsSenderService implemented in our
core Notifea PHP package so they can be easily used anywhere in
your Nette application.
One could inject them like this:
class UserPresenter extends Nette\Application\UI\Presenter { /** @var EmailService */ protected $emailService; /** @var SmsService */ protected $smsService; /** @var SmsSenderService */ protected $smsSenderService; /** * UserPresenter constructor. * @param EmailService $emailService * @param SmsService $smsService * @param SmsSenderService $smsSenderService */ public function __construct( EmailService $emailService, SmsService $smsService, SmsSenderService $smsSenderService ) { $this->emailService = $emailService; $this->smsService = $smsService; $this->smsSenderService = $smsSenderService; } public function actionSendEmail() { // .. your business logic $email = new Email(); // ... $sentEmail = $this->emailService->sendEmail($email); } public function actionSendSms() { // .. your business logic $sms = new Sms(); // ... $sentSms = $this->smsService->sendSms($sms); } public function actionCreateSmsSender() { // .. your business logic $smsSender = new SmsSender(); // ... $createdSmsSender = $this->smsSenderService->createSmsSender($smsSender); } }
EmailService contains these methods:
- getEmails()
- getEmail(string $emailUuid)
- sendEmail(Email $email)
- deleteEmail(string $emailUuid)
SmsService contains these methods:
- getSmss()
- getSms(string $smsUuid)
- sendSms(Sms $sms)
- deleteSms(string $smsUuid)
SmsSenderService contains these methods:
- getSmsSenders()
- getSmsSender(string $smsSenderUuid)
- createSmsSender(SmsSender $smsSender)
- updateSmsSender(SmsSender $smsSender)
- deleteSmsSender(string $smsSenderUuid)
To find more detailed documentation about each method, check out our core Notifea PHP package
Community
Contributing
Dependencies are managed through composer:
$ composer install
Tests can be run via phpunit:
$ vendor/bin/phpunit
notifea/notifea-php-nette 适用场景与选型建议
notifea/notifea-php-nette 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 851 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 05 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「emails」 「email-sending」 「sms-sending」 「transactional-emails」 「transactional-sms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 notifea/notifea-php-nette 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 notifea/notifea-php-nette 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 notifea/notifea-php-nette 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A laravel package for blacklisting or whitelisting specific email providers or domains
Emails addon for Bear Framework
Sendernet transactional email php API client
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
Pure PHP repository for Notifea services.
统计信息
- 总下载量: 851
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-17