After being launched in 2013, the instant messaging platform Slack has become one of the most prominent ways for companies’ employees to connect and communicate with one another. Slack has grown to around 10 million daily users and more than 600,000 organizations using the platform in 2019. With this large and growing user base, FlexDeploy’s Slack plugin allows users to send messages in their workflows and release pipelines. Users are able to make complex beautiful messages, or if you are looking for a simple message, we support that as well. This plugin can be used in many ways such as sending notifications every time a project is built/deployed.
The Slack plugin has two operations, sendAdvancedNotification and sendSimpleNotification.
The simple operation allows users to create and send messages with no knowledge of the Slack messaging API. The plugin operation contains 6 inputs that create the message. You can customize things such as the icon and name of the bot that is sending the message, the contents of the message, and choose whether to send the message as a user.
The advanced operation takes JSON as input to create the message that is sent to Slack. This allows you to customize the message to be whatever you want. Taking this approach requires a knowledge of how a message payload is formatted for the Slack API. Fortunately, this is something you can learn quickly here.
After reading this blog article, you will have the knowledge to add slack notifications to your workflows. We use an example of adding a Slack notification to a deploy workflow in FlexDeploy. For this you will need to create an app on your Slack workspace for FlexDeploy to connect to. You can see how to do this in the plugin guide.
The examples includes a simple build and deploy workflow. First, on the deploy workflow add your preferred Slack plugin operation after the build operation. You will then need to enter the bearer token inside the plugin operation configuration. Slack generates this after adding the Slack app to your workspace. Again, you can find more information about this on the plugin guide. After that, depending on which Slack operation you used you will need to enter different information into the operation’s configuration.
The simple notification inputs are very straight forward. Enter the fields that you would like to use in your message and save. If you would like more information as to what these inputs are and how they are used in a Slack message, you can view more information on the Slack API guide.
Sending an advanced notification requires a few more steps. Luckily you can learn all about the different ways to format a Slack message here. For this example, we will be using a simple message that is formatted.
After setting up the Slack plugin into your workflow, test it out by deploying your project. Once completed, you will see a new message from FlexDeploy in your chosen channel.
The Slack plugin is just the beginning of FlexDeploy’s integration with Slack. We look forward to finding new and helpful ways to allow FlexDeploy users to take advantage of the power of Slack.