Slack

This page is for version 1.1. Read the current version.

For arlanix/notification 1.1.0

Slack

A Slack subscription sends a topic's messages to one Slack channel. It posts through an incoming webhook, a web address that Slack makes for the channel.

You do not set anything up in Stores > Configuration. Each subscription has its own webhook.

1. Make a webhook

  1. Sign in to your Slack workspace and open api.slack.com/apps (opens in a new tab).

  2. Click Create New App, choose Blank app and click Continue.

  3. Name the app, for example Store alerts, choose the workspace and click Continue.

    Create from scratch: the app name Store alerts and the workspace

  4. The app needs no scopes or events of its own. Click Continue to skip them, then click Create.

  5. Slack says that the app cannot do anything yet. Click Create Anyway. The webhook gives the app all it needs.

  6. Under Features, open Incoming Webhooks.

  7. Turn on Activate Incoming Webhooks and click Add New Webhook.

    Incoming Webhooks under Features, Activate Incoming Webhooks turned on, and Add New Webhook

  8. Choose the Channel for webhook, for example #store-alerts, and click Allow. If your workspace needs an admin to approve apps, Slack asks for the approval at this step.

    Allow the app to access Slack: Channel for webhook #store-alerts and Allow

  9. Back on Incoming Webhooks, click Copy next to the new Webhook URL. It looks like https://hooks.slack.com/services/…. Keep the URL secret, like a password. Anyone who has it can post to the channel.

    Incoming Webhooks turned on, and the channel's Webhook URL with Copy

2. Subscribe the channel

  1. Add a subscription on the topic's page or in Subscriptions. See Subscriptions.

  2. Under Delivery, set Delivered by to Slack.

  3. Paste the Webhook URL. The store keeps it encrypted and never shows it again.

  4. Enter the Channel, for example #store-alerts. The grid and the Message Log show this name, because they never show the webhook.

    The subscription form for Slack: Webhook URL and Channel

  5. Save the subscription.

  6. Click Send test message. The test message arrives in the channel.

To change the webhook later, paste the new one. To keep the stored webhook, leave the field empty.

A topic can have only one subscription to the same webhook.

How messages look

Each message is sent as one Slack message. A digest, several messages sent together, is also one Slack message. It looks like this:

  • The subject is in bold, after a mark for the severity: šŸ”“ for an error, 🟠 for a warning, šŸ”µ for info.
  • The text and the details follow.
  • Links work, and Slack shows no preview for them.

If a digest is very long, it shows the messages that fit and ends with the number of the others, for example … and 3 more: see the Message Log. A single message that is too long is cut and ends with …. The Message Log keeps every message in full.

When Slack refuses

When Slack refuses a message, its answer appears in Last delivery on the subscription, and on the message's page in the Message Log. The common answers and what to do:

Slack says What to do
no_service, invalid_token, no_active_hooks, no_team The webhook was removed or turned off, or its app was removed from the workspace. Make a new webhook and paste it into the subscription.
channel_not_found, channel_is_archived The channel was deleted or archived. Make a webhook for a channel that exists.
action_prohibited A workspace admin does not allow posting to the channel. Ask the admin.
Slack asked to wait … second(s) Too many messages went to the channel at once. The store waits as long as Slack asks, one hour at most, and then sends the rest. In the first 24 hours after a message is published, this wait does not use up any of its delivery attempts.

The store tries a failed delivery again by itself. See When a delivery fails. To send it again now, click Retry now on the message's page in the Message Log. It is sent within a minute or so.