Skip to content

[Notifier] Update information for slack on actual implementation #14647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions notifier.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,29 +145,26 @@ GoogleChat ``symfony/google-chat-notifier`` ``googlechat://ACCESS_KEY:ACCESS_T
LinkedIn ``symfony/linked-in-notifier`` ``linkedin://TOKEN:USER_ID@default``
Mattermost ``symfony/mattermost-notifier`` ``mattermost://TOKEN@ENDPOINT?channel=CHANNEL``
RocketChat ``symfony/rocket-chat-notifier`` ``rocketchat://TOKEN@ENDPOINT?channel=CHANNEL``
Slack ``symfony/slack-notifier`` ``slack://default/ID``
Slack ``symfony/slack-notifier`` ``slack://TOKEN@default?channel=CHANNEL``
Telegram ``symfony/telegram-notifier`` ``telegram://TOKEN@default?channel=CHAT_ID``
Zulip ``symfony/zulip-notifier`` ``zulip://EMAIL:APIKEY@ENDPOINT?channel=CHANNEL``
========== ================================ ===========================================================================

.. versionadded:: 5.1

The Mattermost and RocketChat integrations were introduced in Symfony
5.1. The Slack DSN changed in Symfony 5.1 to use Slack Incoming
Webhooks instead of legacy tokens.
The Mattermost and RocketChat integrations were introduced in Symfony 5.1.

.. versionadded:: 5.2

The GoogleChat, LinkedIn, Zulip and Discord integrations were introduced in Symfony 5.2.
The Slack DSN changed in Symfony 5.2 to use Slack Web API again same as in 5.0.

Chatters are configured using the ``chatter_transports`` setting:

.. code-block:: bash

# .env
SLACK_DSN=slack://default/ID
# If your slack webhook looks like "https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX" then use:
SLACK_DSN=slack://default/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX
SLACK_DSN=slack://TOKEN@default?channel=CHANNEL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this true? 🤔

I currently use Symfony 5.2 and the following DSN:

SLACK_DSN=slack://token_to_be_changed@default/T......../B......./q...........

I mean is the channel required? IMO a webhook can only be configured for a dedicated channel which is "included" in the: /XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX

Copy link
Contributor Author

@malteschlueter malteschlueter Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes with 5.2 :)
The slack implementation is now using the Slack API again, see https://api.slack.com/methods/chat.postMessage. Because of that you have to set the target channel and the token of your Slack app.
I used the token under "OAuth & Permissions" in the Slack app configuration interface and add the scope "chat:write". At the end i also had to add the bot by hand to the target channel in Slack.


.. configuration-block::

Expand Down