How to customize your Slack messages when using CircleCI's Slack Orb


If you would like to customize Slack messages to represent CircleCI and include important build information. Below is a template using markdown to get you started.


You can also change the name of your slack bot user to "CircleCI". You can do this by navigating to > your app > Display Information > App name

You can update your app icon to include a CircleCI logo. You can find CircleCI logos and Icons here:

Solution with example

The following code shows an example of setting a slack notification with a custom message which is triggered when the job fails due to the event: fail setting being set:

     - slack/notify:
          event: fail
          custom: | 
                "blocks": [
                        "type": "section",
                        "text": {
                            "type": "mrkdwn",

Once this code is triggered on a failed build it will send the text set within the text section using markdown with the text that has been set.

You might also find it useful to use one of CircleCI's pre-built message templates which you can find here.

Additionally, you can find the source code to these pre-build message templates here:

You can build your own custom templates using Slack's BlocK Kit Builder .

Was this article helpful?
1 out of 4 found this helpful



Article is closed for comments.