Send an automated message to a user or channel in Slack.
You can add a workflow step that sends a Slack message to an individual, public channel or private channel. This is useful for sending notifications to people within your organization. You can also include buttons in the Slack message so that the recipient(s) can respond to the notification and trigger the next step in the workflow.
To send Slack messages from a workflow, you need a direct integration to Slack with the "Send messages" feature enabled.
To check which features are enabled, select the Overview tab, click the menu icon and select Credentials. If required, select Send messages and click Reconnect.
The "Send messages" feature is enabled in the Slack integration settings.
To send messages to a private channel in Slack, you also need to add the Trelica app to the private channel.
Setting the message recipient
You can send Slack messages to individuals, to a public channel or to a private channel.
To send a Slack message to an individual:
Set the Recipient type to Person.
From the To list select one or more roles and/or users.
If the workflow trigger or a previous filter step identified a particular app, selecting a role (such as Business Owner or IT Admin) will send a message to the person in that role for the app in question.
Similarly, if a person using a particular app (such as a person with administrator permissions for the app) has been identified in the workflow trigger or a previous step, selecting App user will identify that person.
If you selected a role rather than specific user in the previous step, there is a risk that the person identified for a particular workflow run will not have an account in your instance of Slack. To ensure that the Slack message is still sent, you can select a backup recipient. The message is only sent to the Slack user identified in the Backup field if the intended recipient (in the To field) does not have an account in Slack.
To send a Slack message to a public channel:
Set the Recipient type to Public channel.
Select the channel name from the list.
To send a Slack message to a private channel:
Set the Recipient type to Private channel.
Open Slack, select the private channel in question and then click the channel name. The channel details dialog is displayed.
The channel ID is displayed at the bottom of the dialog. Copy the channel ID to the clipboard.
Return to Trelica and paste the channel ID into the Channel ID field.
Click the search icon. If Trelica is able to send messages to the channel, the channel name is displayed.
🧙🏾♂️ If Trelica cannot find the channel, ensure you have added the Trelica app to the private channel: in Slack, open the channel details, select Integrations and click Add an App.
Searching for the private channel ID confirms the channel name.
Editing the title and message text
Enter the title and message text that you want to send each time the workflow runs. If the workflow trigger or a previous step identified an app or a person using an app, you can include these details using merge fields. Click Insert field to select from a list of available merge fields. For example, including #application will include the name of the relevant app.
🧙♂️ The title is displayed in the Slack desktop or mobile notification. If you don't include a title, a preview of the message is displayed instead.
To preview the message in Slack, click Test and select a recipient. The message is delivered by the Trelica app.
The "Test" option is displayed when the "Send Slack message" step is selected.
Embedding buttons to drive workflow logic
You can include buttons in a Slack message and use these to drive subsequent workflow steps. This is useful if you need a person to answer a question to determine the next step of the workflow.
For example, if you have a step that sends a Slack message to the IT Admin of a particular app to notify them of unused accounts, you could include buttons to ask if they want to deprovision the user account. If they click "Deprovision", this could trigger a deprovisioning workflow step, whereas if they click "Keep user" this could create a task to remind them to review the situation in a month's time.
You can embed one or two buttons in a Slack message. You can trigger subsequent stages of the workflow based on the button that is clicked or if no response is provided within a specified number of days. Use the workflow outline on the left-hand side to add further steps for each possible outcome.
If you have opted to resend the message if no response is received, the 'No response' route will only become active once the final reminder has been sent and the time limit has again elapsed without a response. For example, if you set the response time limit to five days and configure one reminder, the message will be resent after five days and the outcome will be treated as 'no response' after ten days.
Including buttons in a Slack message.
You can verify the behavior of the buttons by testing the full workflow. Click Save draft or Update and then expand the context menu and click Trigger now.