Receiving Event Alerts in Slack

Receive Dyspatch webhook notifications in Slack using Slack Workflows.

There are two main ways to set this up, depending on how much detail you want in your Slack messages: simple setup or advanced setup

Simple Setup: Direct Webhook

This is the quickest way to get notifications into Slack, but only supports top-level webhook fields due to Slack’s limitations with nested JSON.

To get started with the simple setup, follow these steps:

Build a Slack Workflow

  1. In Slack, go to Automations > Workflows and click New Workflow > Build Workflow.

  2. Choose From a webhook as the trigger.

  3. Add event and text fields as text type Data Variables.

  4. Click done, then click Continue to generate the unique web request URL and return to Workflow Builder.

  5. Click the pencil icon next to from a webhook to view and save your web request URL.

  6. Next, add steps with the desired Slack events and messages, including Data Variables. This could be sending messages to your chosen Slack channels or running follow up automations.

  7. Publish your Workflow.

Note that including nested object fields as Slack Data Variables will cause the notification to fail

Add the Web Request URL to Dyspatch

  1. Navigate to the Developer Tools Dashboard > Webhooks page in the Admin section of Dyspatch

  2. Click Add Webhook.

  3. Paste the Slack web request URL you copied from your workflow and save.

Webhooks Admin page with arrow pointing to the Add Webhook button

You should now receive Dyspatch events as notifications in Slack.

Sample template_published payload:

{
  "event": "template_published",
  "text": "Draft \"New User Signup\" (\"First draft\") has been published\nhttps://app.dyspatch.io/template/tdft_01fds78fsd78dfs7/tdft_01fds798fsda978fds8"
}

Advanced Setup: Include More Webhook Data

If you want to include more detail in your Slack notifications, like data nested in the draft or template objects, you’ll need to use an intermediary server to “flatten” the JSON before sending it to Slack.

Flatten Webhook Payload

This can be done by setting up your own server to receive the webhook payload, or using a third-party service like Zapier, to adjust the payload format.

Data Transmission

Create the Slack Workflow similarly to the simple setup step, adding your newly flattened data variables.

Point your Dyspatch webhooks to be sent to your server or service, perform the data restructuring, then make a POST request to your Slack Workflow's web request URL with the flattened data.

See our Setting up Dyspatch Webhooks guide for more details on webhook payloads and event types.

Example Payload

Here is a sample webhook for the locked_for_translation event.

{
  "draft": {
    "createdAt": "2022-11-30T18:45:11.008906Z",
    "id": "tdft_01gk4xptq0730pc8gsabcd1234",
    "name": "First draft",
    "tags": [
      {
        "id": "tag_02jlfksd89345kjl243",
        "name": "Draft Tag Name"
      }
    ],
    "updatedAt": "2022-12-01T16:16:59.304386Z",
    "url":
   "https://app.dyspatch.io/template/tem_01234emjkk6grw3bq20wz3vznc/tdft_01gk4xptq0730pc8gsabcd1234"
  },
  "event": "template_locked_for_translation",
  "template": {
    "createdAt": "2022-11-30T18:45:11.00703Z",
    "description": "Template description sample text",
    "folder": "Test Workspace",
    "id": "tdft_01gk4xptq0730pc8gsabcd1234",
    "name": "Test template name",
    "path": "fdr_01hqtt049rn4018vrh34123456",
    "tags": [
      {
        "id": "tag_01jfds798fsd79fds7fds9",
        "name": "Template Tag Name"
      },
      {
        "id": "tag_01890fds786hg98fds8fds",
        "name": "Marketing"
      },
    ],
    "type": "Type of email, sms, push, or voice",
    "updatedAt": "2022-12-01T16:16:59.308662Z",
    "workspaceId": "fdr_01hqtt049rn4018vrh34123456"
  },
  "text": "Draft \"First Draft\" (\"Test template name\") was unlocked for translation by Alfred Pennyworth",
  "user": {
    "email": "alfred@dyspatch.io",
    "firstName": "Alfred",
    "lastName": "Pennyworth"
  }
}

Frequently Asked Questions

  • What fields can I use in my Slack Workflow?
    Only top-level fields (event, text, and comment) are supported if sending directly from Dyspatch. Nested fields require an intermediary server.

  • How do I filter for specific events?
    Slack no longer offers conditional steps in their workflow builder, so you must filter the webhooks using an intermediary server or set up a custom function in a Slack app.

  • What happens if I include unsupported fields?
    The Slack Workflow will fail to trigger. Double-check your Data Variables and only include supported fields.

  • Where can I find a list of webhook events? All webhook events are listed on the setting up webhooks page.

  • Need more help?
    Reach out to our support team for assistance!


search icon

Didn't find what you're looking for?

Ask our support team, we're here to help!

Contact Support