Integrating with Slack via Webhooks
Last updated
Last updated
As of version 1.1.0, SitecoreDXG now supports integration with Slack for completion notifications via Slack's Incoming Webhooks API. Like all logic that runs after generation completes, the Slack integration is provided by a native completion handler plugin that calls the Slack API to post a message with some basic information about the generation and any Helix validation errors that were identified.
Depending on the information that you send in via the DocumentationConfiguration
property of the OPTIONS_FILE_PATH
JSON object, you should see a notification similar to the following sample appear in your Slack channel after generation completes:
Fortunately, Slack was nice enough to make the setup super straightforward:
Create a new Slack App for your SitecoreDXG notifications (you just enter a name and select your desired workspace)
Enable Incoming Webhooks for your new app (you just check the box to enable them for your app)
Create a new Incoming Webhook for your new app (you pick the channel that you want to post the messages to and click "Authorize")
Copy your new Incoming Webhook URL for use in the next step
Create/update the JSON file at your OPTIONS_FILE_PATH
with the options object to be passed into your SitecoreDXG middleman to include the Slack completion handler and set its Params.Url
property to your new Incoming Webhook URL, as follows:
Note that this completion handler supports the default supported DocumentationConfiguration
properties, and will display their information in the notification, including:
DocumentationTitle
CommitAuthor
CommitHash
CommitLink
DeployLink
ProjectName
EnvironmentName