Implementing Slack reactions
This page describes how to implement Slack actions in Serialized.The action type (SLACK_POST
) requires the field targetUri
to be populated with a valid Slack webhook URI. The
message text is specified in the field body. Simple templating is supported and event data can be accessed using dot (.)
notation.
Example of a Reaction posting a notification to Slack:
{ "reactionName": "on-order-placed-slack-notifier", "feedName": "order", "reactOnEventType": "OrderPlacedEvent", "action": { "actionType": "SLACK_POST", "targetUri": "https://hooks.slack.com/services/T0000/B0000/XXXX", "body": "A new order with number ${event.data.orderNumber} was placed by ${event.data.customer.email}!" }}
Given this event:
{ "eventId": "ca37d05c-a852-4de5-961f-16fb35e8cd7b", "eventType": "OrderPlacedEvent", "data": { "orderNumber": "12312345", "customer": { "email": "customer@example.com" } }}
the message to Slack will look like this:
A new order with number 12312345 was placed by customer@example.com!