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

# sendAdvancedNotification

> Sends a message to a Slack workspace. This operation requires a JSON payload and a Slack Messaging Account Code. The JSON must be formatted according

Sends a message to a Slack workspace. This operation requires a JSON payload and a Slack Messaging Account Code. The JSON must be formatted according to [Slack's API standards](https://api.slack.com/reference/messaging/payload). 

> [!NOTE]
>
> All Slack operations require a [Slack Messaging Account](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-plugin-guides/flexdeploy-slack-plugin-guide.md).

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Slack Account</td><td>`FDSLACK_INP_CLOUD_ACCT_CODE`</td><td>Yes</td><td>[Slack account code](https://docs.flexagon.com/flexdeploy-11-1-documentation/flexdeploy-plugin-guides/flexdeploy-slack-plugin-guide.md) from Topology->Integrations->Messaging</td></tr><tr><td>Message JSON</td><td>`FDSLACK_INP_MESSAGE_JSON`</td><td>Yes</td><td>JSON for slack message. Formatted based on [Slack API](https://api.slack.com/reference/surfaces/formatting).This input now allows FlexDeploy property replacement notation to be used. e.g. \$\{\{FD\_ENVIRONMENT\_CODE}}This can be useful for writing dynamic message content.</td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><th>**Description**</th></tr><tr><td>`FDSLACK_OUT_MESSAGE_TS`</td><td>Resulting Slack Message Id (TS id) of the newly created message. This can be used start or reply to threads.</td></tr></tbody></table>

# Artifacts

This operation delegates the consume artifacts decision to the workflow developer.

# Endpoint Selection 

This operation delegates the selection to the workflow developer to determine.

# Endpoint Execution

This operations delegates the execution to the workflow developer to decide.

# Special Considerations

### [Formatting Messages](https://api.slack.com/messaging/composing) - Useful guide for creating complex messages

### [Slack Post Message API](https://api.slack.com/methods/chat.postMessage) - Internal API used by this Plugin operation

# Examples

Below is a message JSON payload example. This will send a message to a channel called flexdeploy-demo.

##### **Message JSON example**

```
{
	"channel": "flexdeploy-demo",
	"icon_url": "https://life.meetnext.com/favicon.ico",
	"as_user": false,
	"username": "FlexDeploy",
	"text":"This is a test message for FlexDeploy's slack plugin"
}
```

Below is the final result in the flexdeploy-demo channel.

![Image](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12596421493.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=8375a55d2d9364f302159a8fd0fb4da9)

A more complex message JSON can be found below. 

##### **Complex message JSON**

```
{
	"channel": "random",
	"blocks": [
		{
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Danny Torrence left the following review for your property:"
      }
    },
    {
      "type": "section",
      "block_id": "section567",
      "text": {
        "type": "mrkdwn",
        "text": "<https://google.com|Overlook Hotel> \n :star: \n Doors had too many axe holes, guest in room 237 was far too rowdy, whole place felt stuck in the 1920s."
      },
      "accessory": {
        "type": "image",
        "image_url": "https://is5-ssl.mzstatic.com/image/thumb/Purple3/v4/d3/72/5c/d3725c8f-c642-5d69-1904-aa36e4297885/source/256x256bb.jpg",
        "alt_text": "Haunted hotel image"
      }
    },
    {
      "type": "section",
      "block_id": "section789",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Average Rating*\n1.0"
        }
      ]
    }
	]
}
```

This is the final result in the "random" channel.

![Image](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12596421490.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=55ceda4200741c76bce13bfb3d64a348)
