# Slack

## Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Slack, you'll need to connect your Slack account with MESA.

Click on the **Connect with Slack** button to begin the process.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FtzcIwBCK34w5LBEOAZWh%2FEF-connect-slack.png%20-%20Step%202.png?alt=media&#x26;token=d7675b8f-895e-4f83-acd5-810ff83bdc16" alt=""><figcaption></figcaption></figure>

You will then see this permission screen. Click **Allow.**

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2Fvkf6d1tDq0ZhpfxNl87Q%2FScreenshot%202024-05-29%20at%201.53.20%E2%80%AFPM.png?alt=media&#x26;token=b81090d5-4674-4acd-a089-d7d10bef03a2" alt=""><figcaption></figcaption></figure>

Afterward, you can re-use the newly created connection in your future workflows!

### Inviting the @Mesa Slack bot to your channel <a href="#invite" id="invite"></a>

In Slack, invite the `@Mesa` user to the channel you would like to post in. Type "@Mesa" in a new message and click the **Invite Them** button.

Slack will confirm that the user has been added.

## Configure <a href="#configuring" id="configuring"></a>

### Using Slack Triggers <a href="#channel" id="channel"></a>

Slack [triggers](https://docs.getmesa.com/workflow-builder/triggers) require a separate Slack bot called MESA Triggers, which listens to the channels where it’s added. This means there is a distinction between connections used for MESA Slack Triggers and those used for MESA Slack Actions.

In Slack, invite the `@MESA Triggers` user to the channel you would like to trigger from. Type "@MESA Triggers" in a new message and click the **Invite Them** button.

Slack will confirm that the user has been added.

Additionally, we recommend not adding the MESA Triggers bot to the same channel as the regular MESA bot especially if you're using MESA to send messages to that channel. Doing so can create [infinite loops](https://docs.getmesa.com/best-practices/avoid-infinite-loops).

### Selecting the channel to post to

In MESA, open the **Step Configuration** section of your Slack step. In the **Channel** field, type the first couple letters of your channel name and it should appear in the list. If your channel's name is not appearing in the list, **please make sure** that the `@MESA` user has been invited to the channel.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FGW0D9ul9ODVYW6v9sf9z%2FEF-slack-channel_png_-_Step_2.png?alt=media&#x26;token=6cf994d4-672e-4d7c-920b-168669e6cee6" alt=""><figcaption></figcaption></figure>

You can also manually enter your channel name by clicking "Custom value".

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FN95aLgEVYP9VBiRPApNL%2FEF-slack-custom-value.png%20-%20Step%202.png?alt=media&#x26;token=7a521ea6-a840-4674-b4d7-c0b5c5d1f622" alt=""><figcaption></figcaption></figure>

### Customize your Slack message with Variables <a href="#tokens" id="tokens"></a>

[Variables can be understood](https://docs.getmesa.com/workflow-builder/fields/variables) as a placeholder that will be filled in at the time a workflow runs with actual data. You can click on the **{+}** button in the **Message** field to select variables.

Here is an example of how you could customize your Slack message.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FI1XH983EMi3j3Du4N0zT%2FEF-slack-message-example.png%20-%20Step%202.png?alt=media&#x26;token=7e9a466d-2359-4379-8ce0-316021bc0426" alt=""><figcaption></figcaption></figure>

### Formatting Messages <a href="#formatting" id="formatting"></a>

[Slack's mrkdwn formatting](https://api.slack.com/reference/surfaces/formatting#basics) can be used to add links, make text bold or italic, add lists and more. Emojis can be added with the colon syntax, for example: `:thumbsup:` will be displayed as 👍. Refer to Slack's documentation for more details.

#### Mentioning a specific team member in a Slack message <a href="#mentioning" id="mentioning"></a>

To mention a specific person or bot in slack, just wrap their @ handle in brackets: `<@johndoe>`. For example, this message:

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FKuZJ3XuC163HPDSHRSCb%2FEF-slack-message-example-2.png%20-%20Step%202.png?alt=media&#x26;token=2b72c4de-c51b-4d67-b7e2-479f4c3dfa1d" alt=""><figcaption></figcaption></figure>
