https://github.com/t3n/slack
Flow Framework package that wraps the nexylan/slack library to send messages to slack
https://github.com/t3n/slack
flow flowframework flowpackage neoscms
Last synced: 5 months ago
JSON representation
Flow Framework package that wraps the nexylan/slack library to send messages to slack
- Host: GitHub
- URL: https://github.com/t3n/slack
- Owner: t3n
- License: mit
- Created: 2019-03-05T10:05:56.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-19T05:18:16.000Z (over 4 years ago)
- Last Synced: 2025-04-05T13:23:15.208Z (10 months ago)
- Topics: flow, flowframework, flowpackage, neoscms
- Language: PHP
- Size: 13.7 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/t3n/graphql) [](https://packagist.org/packages/t3n/graphql) [](https://packagist.org/packages/t3n/graphql)
# t3n.Slack
Flow Package to send messages to Slack. This is package wraps the [maknz/slack](https://github.com/maknz/slack) library.
Simply install the package via composer:
```bash
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](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:
```yaml
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
```php
/**
* @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](https://github.com/maknz/slack#sending-messages) for all options that are
available on the message object