t3n/slack

Last activity on 19 July 2021
  • 1
  • 1
  • 3933
composer require t3n/slack

Flow Framework package that wraps the nexylan/slack library to send messages to slack

1.1.0

Flow Framework package that wraps the nexylan/slack library to send messages to slack

Version
1.1.0
Type
neos-package
Release Date
Jan 28, 2020, 1:42:48 pm
Source
git
Distribution
zip
Requires
Requires (dev)
None
Suggest
None
Provides
None
Conflicts
None
Replaces
None
29fd53c9cc7f0b77a3be9ff02e88b7b5467d72a9

CircleCI Latest Stable Version Total Downloads

t3n.Slack

Flow Package to send messages to Slack. This is package wraps the maknz/slack library.

Simply install the package via composer:

composer require "t3n/slack"

Configuration

In order to send messages to Slack you need to add an incoming WebHook to your Slack workspace. Read more about it here https://api.slack.com/incoming-webhooks

As the incoming webhooks are treated as Slack Apps they are bound to a single channel. Therefore you can configure multiple "presets" to use several webhooks:

t3n:
  Slack:
    configurations: 
      myPreset: # you preset name
        webhookUrl: 'https://hooks.slack.com/services/...'
        clientSettings: [] # additional client configurations

Read more about the possible client settings and options here: https://github.com/maknz/slack#settings

Sending messages

/**
 * @Flow\Inject
 * @var \t3n\Slack\Service\SlackService
 */
protected $slackService;

public function sendAMessage()
{
    $message = $this->slackService->createMessage('myPreset');
    $message->send('some message');
}

If you create a message you need to pass the preset name. Check maknz/slack documentation for all options that are available on the message object

The content of the readme is provided by Github
The same vendor provides 11 package(s).