承接 metarush/notifier 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

metarush/notifier

最新稳定版本:v1.0.2

Composer 安装命令:

composer require metarush/notifier

包简介

Send multiple notifications using notifiers like email, Pushover, etc.

README 文档

README

Send multiple notifications using notifiers like email, Pushover, etc.

Install

Install via composer as metarush/notifier

Sample usage

Let's send an email and Pushover notification

use MetaRush\Notifier\Notifier;
use MetaRush\Notifier\Exception;
use MetaRush\Notifier\Pushover\Builder as PushoverNotifier;
use MetaRush\Notifier\Email\Builder as EmailNotifier;
use MetaRush\EmailFallback\Builder as EmailBuilder;
use MetaRush\EmailFallback\Server;

// ------------------------------------------------

// define a Pushover notifier

// you can use `addAccount()` multiple times for additional accounts

$pushoverNotifier = (new PushoverNotifier)
                        ->addAccount('pushover_app_key', 'pushover_user_key')
                        ->setSubject('test subject')
                        ->setBody('test body')
                        ->build();

// ------------------------------------------------

// define an email notifier

// you can use multiple STMP servers for failover (see package `metarush/email-fallback` for more options)

$servers = [
        (new Server)
            ->setHost('smtp_host')
            ->setUser('smtp_user')
            ->setPass('smtp_pass'])
            ->setPort(465)
            ->setEncr('TLS')
];

$emailBuilder = (new EmailBuilder)
                    ->setServers($servers)
                    ->setTos(['test@example.com'])
                    ->setSubject('test subject')
                    ->setBody('test body')
                    ->setFromEmail('test@example.com');

$emailNotifier = (new EmailNotifier)
                    ->setEmailFallbackBuilder($emailBuilder)
                    ->build()

// ------------------------------------------------

// put them together and send

$notifiers = [
    $pushoverNotifier,
    $emailNotifier
];

(new Notifier($notifiers))
    ->send();

Current notifiers

  • Email
  • Pushover

Feel free to use or contribute your own notifier. Use the Pushover notifier as starting guide.

统计信息

  • 总下载量: 151
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固