- Slide Deck - https://docs.google.com/presentation/d/1Qsz_CFvs-1qHIRwkMjlp_7vP8ynY7blh/edit#slide=id.p1
- Video Walkthrough - Coming Soon!
- Q & A - Coming Soon!
This is achieved using the new Workflow Builder feature in Slack and External Services in Salesforce. Here are the steps in brief:
-
Using the Slack Workflow Builder, create and publish a Workflow that post messages into a Slack Channel and is triggered by a Webhook. Read for more info: https://slack.com/intl/en-in/help/articles/360035692513-Guide-to-Workflow-Builder.
-
Construct a Swagger Schema for the Webhook provided by Slack (in Step 1). Use the Template given below to get started.
-
Created a Named Credential in Salesforce with URL - https://hooks.slack.com. (No Auth)
-
Import the Swagger Schema constructed in Step 2 using External Services.
{
"swagger": "2.0",
"info": {
"title": "Slack + Salesforce",
"description": "Instantly Send Messages to Slack from Salesforce",
"version": "1.0.0"
},
"host": "hooks.slack.com",
"schemes": [ "https" ],
"paths": {
"[REPLACE THIS WITH YOUR WEBHOOK]": {
"post": {
"consumes": [ "application/json" ],
"parameters": [
{
"in": "body",
"name": "slackMessageRequest",
"type": "object",
"required": true,
"schema" : {
"$ref" : "#/definitions/SlackMessageRequest"
}
}
],
"responses": {
"200": {
"description": "Successful Operation"
}
}
}
}
},
"definitions": {
"SlackMessageRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
β οΈ Note: To validate a Swagger Schema (written by yourself), visit - http://editor.swagger.io/.
β οΈ Note: Please DO NOT forget to replace[REPLACE THIS WITH YOUR WEBHOOK]
in the above Template Swagger Schema with the Webhook of your Slack Workflow.