1. Notifications
  2. Slack

Notifications

Slack

Setup and send slack notifications.

The stubber slack bot can do the following:

  • Message any user in a workspace
  • Message any channel that is public
  • Message private channels (the bot has to be manually added to the channel by an admin)

Adding a Slack notification profile

Before you'll be able to send and receive slack notifications, you'll need to create a slack notification profile.

Navigate to Manage to connect your slack workspace to stubber.

Pick the slack app you'd like to connect, you can use the default Stubber app or create your own slack app. Click Connect to Slack to continue.
You will be presented the Slack authorization screen, where you can select the workspace and authorize the app.

If successful, you'll be redirected back to your newly created slack notification profile on Stubber.

Message Routing

When a new message is posted in a slack channel, there are a few mechanisms that determine which stub the message is sent/routed to.

  1. Thread Reply Routing
    • If the message is a reply to another slack message, the message will be sent to the same stub as the parent message, if found.
  2. Stub Session Routing
    • If a stubsession was set when an outgoing message was sent (see below), and the session is still active, the incoming message will be sent to the stub that created the session.
  3. Profile Channel Routing
    • On the slack notification profile, you can configure several channel<->stubref mappings. If the incoming message is from one of these channels, the message will be sent to the mapped stub.
    • A special channel mapping of __catch_all can be used to route all unmatched messages to a specific stub.

Stubsessions

A stubsession is a temporary link between a slack channel (DMs and channels) and a specific stub.
When a stubsession is active, all incoming messages from that channel will be routed to the stub that created the session.

A stubsession is created by including the stubsession object when sending a slack message, as shown in the examples below. The set_new_with_timeout_hours parameter specifies the duration of the session in hours.

If the stubsession object is not included when sending a message, no session will be created.

If the set_new_with_timeout_hours parameter is set to 0, the session will last indefinitely until manually cleared.

If you'd like a different feedback action to be triggered when a stubsession message is received, you can specify the stubsession.set_feedback_action parameter with the name of the feedback action to trigger.

Default is _update_from_slack.

Slack Contact Points

Messages can be sent directly to slack channels, or to Stubber contacts.
Contacts will need to have a slack contact point configured, as shown below.

The Workspace/Team ID is the unique identifier of your slack workspace, and can be found in the slack workspace settings but is also shown on the notification profile page after connecting your slack workspace.

The slack contact point requires the Workspace/Team ID and either a User ID or Channel ID.

Find a User ID

User ID

Required
String

  • Navigate to a users profile

Find a channel ID

Channel ID

Required
String

  • Navigate to a channel and go to its settings

Sending a slack message using a contactuuid

loading...

Sending a slack message using a raw Channel or User ID

The Team ID embedded in the profile linked by the profileuuid will be used.

loading...

Sending a slack message to a channel (simple)

You can also specify the target channel directly in the Slack message, as well as other message parameters.

loading...

See the Slack API documentation for all available parameters.
For example, you can use blocks to create rich message layouts.