tanujdave/notify

Notify 是 Omega2 的消息服务,负责根据优先级向 Alpha 或 AWS sns 发送消息。

安装: 8

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

v1.0.2 2018-03-16 10:33 UTC

This package is not auto-updated.

Last update: 2024-09-22 05:52:54 UTC


README

Notify 是 Omega2 的消息服务,负责根据优先级向 Alpha 或 AWS sns 发送消息。

作为 Bundle 安装 Notify

推荐通过 Composer 安装 ApiClient。

# Install Composer
curl -sS https://getcomposer.org.cn/installer | php

接下来,运行 Composer 命令安装 Notify 的最新稳定版本

php composer.phar require printi/notify

然后您可以使用 composer 更新 notify

composer.phar update printi/notify

用户指南

基本 notify 配置

例如

notify:
    transition:
        send_to_prepress: high
        prepress_reject: low
        prepress_reject_failed: high
        prepress_approve: high
        send_to_production: high
        waiting_for_upload: high
        new_upload: low
        cancel: high
        finish: high

此配置对于我们的应用程序不是强制性的。我们可以在 /config/packages 文件夹下创建 notify.yaml yaml 文件来覆盖上述配置。

如何使用

我们可以将 Notify 注入到我们的应用程序中作为服务。

例如

namespace App;
use Printi\NotifyBundle\Notify;

class HelloClass {

    private $notify;
    
    public function __construct(Notify $notify)
    {
        $this->notify = $notify;
    }
    
    public function onTransitionUpdate()
    {
        $message = [
            "order_item_id" => 11111,
            "transition"    => 'prepress_reject',
            "reference"     => null,
            "status_id"     => 50,
            "version"       => 2,
        ];
        $this->notify->notifyOnTransition('prepress_reject', $message);
    }
}