Giter Site home page Giter Site logo

astrotomic / notifynder-sender-slack Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 6 KB

Slack Sender for the Notifynder package.

Home Page: http://notifynder.info/

License: MIT License

PHP 100.00%
notifynder slack slack-sender php package laravel notification-api notification-service notifications

notifynder-sender-slack's Introduction

Notifynder 4 Slack Sender - Laravel 5

GitHub release GitHub license GitHub issues Total Downloads

StyleCI

Code Climate

Slack Team Slack join

Documentation: Notifynder Docu


Installation

Step 1

composer require astrotomic/notifynder-sender-slack

Step 2

Add the following string to config/app.php

Providers array:

Astrotomic\Notifynder\NotifynderSenderSlackServiceProvider::class,

Step 3

Add the following array to config/notifynder.php

'senders' => [
    'slack' => [
        'webhook' => 'https://hooks.slack.com/...',
        'store' => false, // wether you want to also store the notifications in database
    ],
],

Register the sender callback in your app/Providers/AppServiceProvider.php

<?php
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Astrotomic\Notifynder\Senders\SlackSender;
use Maknz\Slack\Message as SlackMessage;
use Fenos\Notifynder\Builder\Notification;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        app('notifynder.sender')->setCallback(SlackSender::class, function (SlackMessage $message, Notification $notification) {
            // handle the message and append the from, to, icon and so on
            // https://github.com/maknz/slack#explicit-message-creation
            // you don't have to set the message text, by default (if empty) it is set in the sender itself
            // just return the message, don't send it - otherwise you will get the message two times
            return $message;
        });
    }
}

notifynder-sender-slack's People

Contributors

gummibeer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.