Step: Post to Slack

This output step uses Slack's Webhook functionality to send a customized message to your company Slack channel.


Allows FreeMarker Expressions

Requires Slack Data Source

  • Webhook Source: Choose the Slack Source you would like to use. This is a Webhook address you request from Slack and enter as a Data Source
  • Channel: The webhook is connected to a specific channel when you configure it with Slack, but you can specify any of your Slack channels here and the message will be sent to that channel instead.
  • Color: The Slack message includes a colored stripe down the left side of the message. Choose from the list of available colors or choose White for no color.
  • Slack Message Content: This is where the body of the message from DarkLight is written. You can use any of the Slack markup syntax and you can also use FreeMarker Expressions

This message will create the output below. (The "if" statements in the FreeMarker template let the step continue even if there are no values for the variables listed.)

Alert on the demo feed by <#if username??>${username[0][0]}<#else> (unknown user)</#if> on <#if computerName??>${computerName[0][0]}<#else> (unknown computer)</#if>.

Event ID: ${trigger}

If you include the DarkLight FreeMarker variable named ${trigger} you will get the full IRI of the publishing object. This can be pasted into the Search box on the Review perspective to jump directly to that event.

TIP: If you use <!here> it will turn into @here when it posts, notifying everyone who is currently active on Slack and connected to that channel.

Warning: Don't Send Too Much Data

The Slack API is intended for "…no more than one message per second. [They] allow bursts over that limit for short periods." If you exceed this limit, you'll a "ERROR Failed to execute step: com.champtc.champ.step.postToSlack" in your Log view or Console of DarkLight. The Slack website says that if you continue to send data after the warnings, they will disconnect your application. See Also: https://api.slack.com/docs/rate-limits
  • step/post-to-slack
  • Last modified: 2019/02/05 01:29