# Slack

## Overview

The **Slack transport** provides the ability to send alerts to a Slack channel which can drive further processing.

Property placeholders are used to provide additional context to the message. Properties need to be present within the final event generated by the select projection.

## Example & DSL attributes

This example configures the **Slack transport** to send alerts to the `iot_sensor_alert` channel.

```yaml
slack publisher:
  name: iot_sensor_alert
  api token: xoxb-xxxxxx-xxxxxx-xxxxxx-xxxxxx
  channels:
    - iot_sensor_alerts
  message template: Toggling sensor {sensorId} humidifier valve state to {valve_signal} (1:ON | 0:OFF)
  inform users:
    -U0783OPG7CL
```

As an example the above configuration upon receiving the following event from a processing stream:

```yaml
emit:
    select: "sensorId, valve_signal"
```

Would generate and publish the message below on to the `iot_sensor_alerts` slack channel

```
// Created message
2025-02-19 14:34:46 - Toggling sensor 1001 humidifier valve state to 1 (1:ON | 0:OFF)
@Lyndon
```

### Attributes schema

<table><thead><tr><th width="150">Attribute</th><th width="371">Description</th><th width="127">Data Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>name</td><td>Logical name for the configuration</td><td><p>String</p><p></p></td><td>true</td></tr><tr><td>api token</td><td>Slack api <strong>bot</strong> token. This is provided either within the configuration file or as the <code>SLACK_API_TOKEN</code> environment variable.</td><td>String</td><td>true</td></tr><tr><td>user email</td><td>This is the user email to use to send messages to a channel is provided</td><td>String</td><td>false</td></tr><tr><td>channels</td><td>List of channels to publish message on to</td><td>List&#x3C;String></td><td>true</td></tr><tr><td>message template</td><td>Message template that applies the selected attributes from an emitted event to the message i.e. {sensorId} is replaced by the corresponding value in the event.</td><td>String</td><td>true</td></tr><tr><td>inform users</td><td>List of slack member ids to add to the message. <a href="https://slack.com/help/articles/360003827751-Create-a-link-to-a-members-profile-">Member Ids are found on the user profile</a>.</td><td>List&#x3C;String></td><td>false</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fractalworks.io/joule/components/connectors/sinks/custom-connectors/slack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
