定制 carlcs/craft-pushovernotificationchannel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

carlcs/craft-pushovernotificationchannel

Composer 安装命令:

composer require carlcs/craft-pushovernotificationchannel

包简介

A Pushover notification channel for the Craft Notifications plugin

README 文档

README

A Pushover notification channel for the Craft Notifications plugin

Requirements

The plugin requires Craft CMS 3.0 or later, and the Craft Notifications plugin.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to load the plugin:
composer require carlcs/craft-pushovernotificationchannel
  1. In the Control Panel, go to Settings → Plugins and click the “Install” button for Pushover Notification Channel.

Usage

To configure a notification to be sent via Pushover, make sure your via() method on the Notification class returns a key with pushover.

<?php
namespace app\notifications;

use carlcs\pushovernotificationchannel\models\PushoverMessage;
use carlcs\pushovernotificationchannel\models\PushoverReceiver;
use rias\notifications\models\Notification;

class ElementSaved extends Notification
{
    public function via()
    {
        return [
            'pushover' => '<PUSHOVER_USER_OR_GROUP_KEY>',
        ];
    }

    public function toPushover($notifiable)
    {
        $element = $this->event->sender;

        return PushoverMessage::create("Element saved {$element->title}")
            ->sound('incoming')
            ->lowPriority()
            ->url($element->getUrl(), 'Go to element page');
    }
}

The pushover value in the via() method can also be a PushoverReceiver object. This allows to specify devices, or to overrule the API Token set in the plugin settings.

return [
    'pushover' => PushoverReceiver::withUserKey('<PUSHOVER_USER_OR_GROUP_KEY>')
        ->toDevice('iphone')
        ->withApplicationToken('<PUSHOVER_API_TOKEN>');,
];

Credits

Laravel Notifications Channel - Pushover

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固