> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwoty.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Send a notification message and/or the quote PDF to a Slack channel when a quote is signed.

## Overview

This integration posts a message to a Slack channel when a quote is signed in Qwoty. Optionally, it also uploads the quote PDF to the same channel.

***

## Authentication

You need a **Slack Bot Token** (`xoxb-...`) to authenticate requests.

1. Go to [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → **From scratch**
2. Under **OAuth & Permissions**, add the following Bot Token Scopes:
   * `chat:write` — to post messages
   * `files:write` — to upload PDFs
3. Click **Install to Workspace**, then copy the **Bot User OAuth Token**
4. Invite the bot to your target channel: `/invite @YourAppName`

<Warning>
  The bot must be invited to the channel before it can post messages or upload files. API calls will return `not_in_channel` otherwise.
</Warning>

<Note>
  Use the **Channel ID** rather than the channel name (e.g. `C0123ABC456`). Find it by clicking the channel name → **About** tab → bottom of the panel.
</Note>

***

## Settings

| Key               | Default | Description                                 |
| ----------------- | ------- | ------------------------------------------- |
| `token`           | —       | Slack Bot Token (`xoxb-...`). **Required.** |
| `message_channel` | —       | Target channel ID or name. **Required.**    |
| `document_send`   | `true`  | Upload the quote PDF to the channel.        |

***

## Output

### Message

A message is posted in the configured channel in the **language of the quote** (EN, FR, DE, IT, PT, ES).

| Quote field                            | Used for                  |
| -------------------------------------- | ------------------------- |
| `owner.first_name` + `owner.last_name` | Sales rep full name       |
| `customer.name`                        | Company name              |
| `summary.one_off.net_amount`           | One-off net amount        |
| `summary.metrics.mrr`                  | Monthly recurring revenue |

**Example (FR):**

```text theme={null}
🎉 BREAKING NEWS :
Emmanuel Laureau vient de signer l'entreprise Hubspot — One-off : 100,00 €
```

**Example (EN):**

```text theme={null}
🎉 BREAKING NEWS :
Emmanuel Laureau just signed Hubspot — One-off: 100.00
```

<Note>
  Amounts equal to zero are not displayed. A quote with One-off = 0 and MRR = 150 will show only `MRR : 150,00 €`.
</Note>

<Note>
  If the quote has no owner, the message uses a generic format: `New signature — Company`.
</Note>

### PDF upload

If **Send document** is enabled, the quote PDF is uploaded to the same channel.

The file is named: `YYYYMMDD-CompanyName.pdf`

<Note>
  If the quote has no PDF, the upload is skipped even if Send document is enabled.
</Note>
