# Slack

Receive instant Fours notifications and alerts in your Slack workspace.

---

:::info
Fours was formerly named Suger. In Slack, the app and its bot — the name you invite with `/invite @Suger` and the sender of every notification — still use the name Suger until the app is renamed.
:::

## Overview
By connecting with Suger app for Slack in your Slack workspace, you and your team can get instant notifications & alerts as soon as possible if any important sales operations are happening cross your cloud marketplaces.

### Org-Level vs User-Level

- **Org-Level**: One shared workspace installation for the whole organization. Fours posts as the **Suger bot**, and this is what drives the notification and alert configuration described below. Set up once by an administrator under **Settings → Integrations**.
- **User-Level**: You connect Slack as **yourself** under **User Integrations**. Fours mints a user token alongside the bot token, so when Fours AI sends a Slack message on your behalf it is posted **as you** — your name and avatar — rather than as the Suger bot. Directory lookups (finding channels and workspace members) still run on the bot token issued alongside it.

The user-level connection requests these Slack user scopes:

| Scope | What it allows |
|-------|----------------|
| `chat:write` | Post messages as you, in channels and conversations you can already post to. |
| `channels:read` | Look up public channels by name so a destination can be resolved from what you typed. |
| `groups:read` | Look up the private channels you are a member of. |
| `im:write` | Open a direct-message conversation so a message can be sent to a person. |

:::info
The two levels are independent. Connecting Slack as a user does not change or replace your organization's notification installation, and you do not need a user-level connection to receive Fours notifications.
:::

## Create Integration
In your [Fours Console Integration](https://console.suger.io/settings?tab=integrations), you will see the Slack integration connection status. Click the `Connect` button to install the Suger app for Slack. This will redirect you to Slack's website. If you are not yet logged in to your Slack workspace, you will be prompted to first login.

Once you are authenticated, you will be asked to allow the Suger app for slack to access your workspace. You must provide a Slack channel (e.g. #suger-alerts) created ahead of time to receive Fours notifications in. Click the `Allow` button:

> <img src="https://user-images.githubusercontent.com/98442625/217121795-8d161a25-7490-4019-b3a4-fb4821f73bd9.png" alt="Allow button for Suger Slack app permissions" style="max-width:450px;width:100%;display:inline;margin:0 auto;box-shadow: 5px 5px 5px #eee" />

Once the installation is complete, you should receive a notification in your Slack workspace that the app was successfully installed. Your browser will be redirected to your Fours console, indicating the Slack integration status as `connected`. Click Verify, your slack channel will receive a verification message from Suger app, and the integration status is updated as `verified`.

:::warning
- If you choose a **private channel** for Fours notifications or set it to private after integrating, you must invite the `Suger app` to the channel; otherwise, the `Suger bot` won't be able to send messages — notifications will fail silently.
- To invite the app, open the private channel in Slack and type `/invite @Suger`. How to invite `Suger app` to the **private channel** is also shown below.
:::

> <img src="https://imagedelivery.net/pNNvR2_tZYczcQ3leBU_1A/b619ac7e-eb8e-4fc6-6e2e-264c8344f000/square" alt="Inviting Suger app to a private Slack channel" style="max-width:600px;width:100%;display:inline;margin:0 auto;box-shadow: 5px 5px 5px #eee" />

## Configure Notification

Once you've connected the Suger app to your Slack workspace, you cannot directly modify the authentication scopes. The recommended approach is to delete the app and then re-install it in the same Slack workspace.

You are allowed to edit the notification configurations below:
- **Enable Notification**: Enable or disable the notification in the Slack channel by toggling the switch. Use this master toggle to pause or resume all Slack alerts instantly.
- **Notification Scope Configs**: You can configure the notification scopes and their corresponding destination slack channels, so specific alerts can go to different teams. For example, route `CREATE` actions to `#sales-wins` and `CANCEL` actions to `#customer-success`. To add a new scope, click `Add notification scope`.

    ><img src="https://imagedelivery.net/pNNvR2_tZYczcQ3leBU_1A/1bb86311-1659-4a1c-42aa-2fa0bcfdd400/square" alt="Add notification scope form for Slack channels" style="max-width:880px;width:100%;display:inline;margin:0 auto;box-shadow:5px 5px 5px #eee" />

## Fours AI Tools

Beyond the notification channel described above, a connected Slack workspace also gives Fours AI a small set of Slack capabilities. Fours AI can:

| Capability | What it does |
|------------|--------------|
| **Send a message** | Post a message to a channel, a private channel, or as a direct message to a person. You can give a channel name (`#sales-wins`), a channel id, or a person — Fours resolves it to the real destination before sending. |
| **Find channels** | Search the workspace for channels whose name contains what you typed, so you can say "post this in the deals channel" without knowing its id. |
| **Look up one channel** | Given a channel id, return which channel it actually is — its name, whether it is private or archived, its topic and purpose, and whether the connected Slack account is a member. Fours uses this to tell you the channel **name** before it posts to an opaque id, and to warn you when a send would fail because the account has not joined that channel. |
| **Find a person** | Look up workspace members by email address, or by part of their handle, real name, or display name, so a message can be addressed to a person rather than to a channel. Every match is returned rather than a single guess — if more than one person matches, Fours asks you which one it should use. |

Which Slack account these run against depends on how Slack is connected. With only the org-level installation, messages are posted by the Suger bot. If you have also connected Slack at the user level, messages are posted **as you**, while channel and member lookups continue to use the bot token.

:::warning[Sending is gated on your approval]
Fours AI **cannot send a Slack message silently.** Every send is held for a human **approve / reject** decision first — you see the destination and the message text and must approve it before anything is posted. Rejecting it stops the send. The read-only capabilities above (finding channels, looking up a channel, finding a person) are not gated this way.

Because an id like `C0123ABCD` tells a person nothing, Fours resolves an opaque channel id to its name before asking you, so the approval prompt shows the channel you would actually be posting to.
:::

If a send is approved but the destination is a private channel the connected account has not joined, Slack rejects it (`not_in_channel`) and Fours reports the failure — it never reports a silent success. Invite the account to the channel and try again.

## Delete Integration

The Slack integration can be deleted like all other integrations. Once the deletion is triggered, all integration info including the access token will be deleted immediately & permanently from Fours. No time window or methods to recover. 

:::warning
- To completely delete the integration, please uninstall the Suger app from [your slack workspace](https://app.slack.com/apps-manage/).
:::

## Type of Notifications

Each notification scope pairs an **Action** with the **Entity** it happened to, and the **Notification Scopes** picker lists it as `ACTION.ENTITY` — for example `CREATE.OFFER`. The picker always shows the current set of scopes Fours can send to Slack.

### Offer and entitlement scopes

The offer and entitlement entities and actions are listed below:

|  |  | 
| ---------------- | :-------- |
| `Entity` | The type of the `entity` who can do `action` is one of:<ul><li>`OFFER`</li><li>`ENTITLEMENT`</li></ul>  |
| `Action` | The action performed. Can be one of:<ul><li> `CREATE`: the entity is created.</li><li>`PENDING_START`: the entity `ENTITLEMENT` is pending to start.</li><li>`CANCEL`: the entity is cancelled. </li><li>`PENDING_CANCEL`: the entity `ENTITLEMENT` is pending to be cancelled.</li><li>`SUSPEND`: the entity is suspended, it may be reinstated or cancelled in the future.</li><li>`REINSTATE`: the entity is reinstated from suspended state.</li><li>`UPDATE`: the entity is updated.</li><li>`EXPIRE`: the entity `OFFER` is expired</li><li>`TEST`: for testing purpose only.</li></ul> |

The table below summarizes what the most common actions mean for your business:

![Slack notification configuration in the Fours Console](images/integrate-slack-with-suger-1.png)

| Action | Marketplace Event Description |
| --- | --- |
| CREATE | A new offer is generated or a buyer officially starts a subscription. |
| CANCEL / SUSPEND | A contract has been terminated or paused by the buyer or provider. |
| EXPIRE | A private offer has reached its end date without being accepted. |
| PENDING_START | An entitlement is scheduled to begin at a future date. |
| UPDATE | Metadata or resource changes have been made to an existing contract. |

Here is an example of notification you will receive in your Slack channel when a new offer is created:

<img src="https://user-images.githubusercontent.com/98442625/217120659-95accaa6-573b-444b-a44f-9937bd34de50.png" alt="Example new offer notification in Slack" style="max-width:70%;display:inline;margin:0 auto;box-shadow: 5px 5px 5px #eee" />

### Partner co-sell and commission scopes

If you run a partner program in Fours, the picker also offers eight co-sell scopes (`SUGERCOSELL`) and nine commission scopes (`COMMISSION`). Map them to a channel under [Notification Scope Configs](#configure-notification) to get co-sell and commission lifecycle alerts in Slack alongside the emails you already receive. Each card opens with the header below, followed by the deal name when there is one.

| Scope | Card header |
| --- | --- |
| `CREATE.SUGERCOSELL` | **New co-sell registered** on the side that registered it; on the receiving side, **New co-sell from {partner name}** or **New co-sell shared with you** |
| `REGISTER_ON_BEHALF.SUGERCOSELL` | **Co-sell registered on behalf of {partner name}**; on the partner's side, **Co-sell registered on your behalf** |
| `ACCEPT.SUGERCOSELL` | **{partner name} accepted**, or **Co-sell accepted** |
| `DECLINE.SUGERCOSELL` | **{partner name} declined**, or **Co-sell declined** |
| `CLOSE_WON_REMINDER.SUGERCOSELL` | **Closed Won** |
| `CLOSE_LOST.SUGERCOSELL` | **Closed Lost** |
| `COMMISSION_TERMS_UPDATED.SUGERCOSELL` | **Commission terms updated** |
| `DEAL_UPDATED.SUGERCOSELL` | **Co-sell updated** — sent only while the seller has **Partners — Deal update emails** switched on |
| `PENDING.COMMISSION` | **Commission pending** |
| `APPROVE.COMMISSION` | **Commission approved** |
| `PAYMENT_SENT.COMMISSION` | **Payment sent** |
| `PAYMENT_CONFIRMED.COMMISSION` | **Payment confirmed** |
| `PAYMENT_REJECTED.COMMISSION` | **Payment rejected** |
| `CLAWBACK.COMMISSION` | **Commission reversed** |
| `UPDATE_PROPOSED.COMMISSION` | **Commission update needs approval** |
| `UPDATE_APPROVED.COMMISSION` | **Commission update approved** |
| `UPDATE_REJECTED.COMMISSION` | **Commission update rejected** |

A card links to the deal or commission with **Open in Fours**, but never carries a one-click action, because anyone in the channel could click it. A copy that comes with a one-click link — the link a partner uses to approve a commission update, or to confirm a co-sell registered or closed on its behalf — is sent by email only. For what each alert contains, see [Co-Sell and Commission Alerts in Your Team's Channels](/prm/connect-slack-for-partners/#co-sell-and-commission-alerts-in-your-teams-channels).
