# Recipe: post to Slack when a deal is signed

> A record-triggered Flow on Envelope that uses Salesforce's Send Slack Message action.

Tally Sign University › [Automation](https://sign.gettally.io/university/automation)

This recipe uses only Salesforce: a Flow on the Envelope object and Salesforce's own **Send Slack Message** action. Tally Sign keeps the Envelope's Status current, which is what triggers the Flow.

## Before you start

- Your Slack workspace is connected to Salesforce, with a Salesforce app for Slack (for example Sales Cloud for Slack) installed. This makes **Send Slack Message** available in Flow.
- The Tally Sign package is installed and Salesforce is connected.
- You know the Slack channel to post to, for example `#deals`.

## Build the Flow

1. In Setup, open **Flows** and choose **New Flow → Record-Triggered Flow**.
2. Set **Object** to **Envelope**.
3. Set **Trigger the Flow When** to **A record is updated**.
4. Under **Set Entry Conditions**, add **Status** Equals `Completed`.
5. Under **When to Run the Flow for Updated Records**, choose **Only when a record is updated to meet the condition requirements**, so it posts once.
6. Under **Optimize the Flow for**, choose **Actions and Related Records**.
7. Add an **Action** and search for **Send Slack Message**.
8. Choose the Slack app and workspace, and set the channel.
9. Write the message using fields from the envelope (see below).
10. Save it as **Post signed deals to Slack** and choose **Activate**.

A message template that works well:

```
Signed: {!$Record.Related_Record_Name__c}
{!$Record.Name} · {!$Record.Amount__c} {!$Record.Currency_Code__c}
Sent by {!$Record.Sent_By_Name__c} · {!$Record.Days_To_Sign__c} days to sign
{!$Record.Document_URL__c}
```

> **Note:** Installed from the Tally Sign install link, the package's API names start with `TallySign__`, for example `{!$Record.TallySign__Related_Record_Name__c}`. Picking the fields in the resource picker inserts the right names.

> **Note:** To run the Slack step after the order is created, put it on an asynchronous path. The **Created Order** field is filled a few seconds after completion.

## Test it

1. Send a test document to yourself from a quote.
2. Sign it. The Envelope's Status changes to **Completed**.
3. The message appears in the channel. If not, check **Setup → Paused and Failed Flow Interviews**.

Next guide: [Seats](https://sign.gettally.io/university/admin/seats)

Source: https://sign.gettally.io/university/automation/slack-recipe
