t3n/slack

There is no license information available for the latest version (1.1.0) of this package.

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

Maintainers

Details

github.com/t3n/slack

Source

Issues

Installs: 4 081

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 7

Forks: 1

Open Issues: 2

Type:neos-package

1.1.0 2020-01-28 13:42 UTC

This package is auto-updated.

Last update: 2024-12-19 12:33:18 UTC


README

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