2017 © Pedro Peláez
 

craft-plugin craft-pushovernotificationchannel

A Pushover notification channel for the Craft Notifications plugin

image

carlcs/craft-pushovernotificationchannel

A Pushover notification channel for the Craft Notifications plugin

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Pushover Notification Channel plugin for Craft Notifications

A Pushover notification channel for the Craft Notifications plugin, (*1)

Requirements

The plugin requires Craft CMS 3.0 or later, and the Craft Notifications plugin., (*2)

Installation

To install the plugin, follow these instructions., (*3)

  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., (*4)

<?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., (*5)

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

Credits

Laravel Notifications Channel - Pushover, (*6)

The Versions

09/03 2018

v1.x-dev

1.9999999.9999999.9999999-dev

A Pushover notification channel for the Craft Notifications plugin

  Sources   Download

MIT

The Requires

 

notifications pushover craftcms

09/03 2018

1.0.0

1.0.0.0

A Pushover notification channel for the Craft Notifications plugin

  Sources   Download

MIT

The Requires

 

notifications pushover craftcms