For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send Slack Messages via Webhook

Use Hackle webhooks to automate various Slack messages to be delivered at the desired time.

This guide provides instructions on how to send event-based personalized Slack messages.

Configure the Webhook

Follow the steps below to set up the Slack message send webhook.

1

Create a Slack App

First, add the Webhook app to the Slack channel you want to send messages to.

Create a new app in Slack.

Click Create New App.
Select From scratch.
2

Register Incoming Webhooks

Open the app you created and navigate to the Incoming Webhooks menu.

Change the toggle to On.

Change the Toggle to on.

Click Add New Webhook to Workspace.

Then select the Slack channel you want to send messages to.

3

Confirm the Webhook URL

Copy the generated Webhook URL.

This URL will be used shortly for the webhook campaign settings.

4

Create a Webhook Campaign

Create a new webhook campaign in the Hackle Dashboard.

Click Create New Campaign.
5

Configure Request Information

Endpoint Settings

Paste the Webhook URL copied previously.

Slack message sending must be configured as a POST request.

Body Settings

First, you can test with a simple message as below.

{
  "text": "Hello, World!"
}

Paste the above JSON into the Body input field and save.

6

Send a Test Message

Verify that the configured webhook works correctly.

Click the Send Test Message button.

If the call succeeds, you can see the following result.

Test send result

Test sending actually sends an HTTP request to the registered Endpoint.

The response value also shows the actual value returned from the Endpoint as-is.

Also check the Slack channel to confirm the message has arrived.

7

Configure Personalized Messages

Now modify the Body to send Slack messages in the desired format at the desired time.

First, decide which event to use as the trigger.

  • Search for the event you want to use as a trigger.

  • Check the properties collected along with the event.

  • Event properties and user properties are used for personalization.

If you're not familiar with event properties and user properties, refer to the Property Guide.

Fields such as fallback, text, pretext, color, and attachments follow the Slack Message Payload specification.

You can freely compose messages to match the Slack format.

Personalization syntax uses Liquid.

You can type it directly, but if you're not familiar with it, using the Add Personalization Variable modal is more convenient.

You can open the Add Personalization Variable modal.

Slack Message Delivery Body Sample

{
  "fallback": "Failed to compose in-app message display notification message.",
  "text": "{{event_properties.in_app_message_key | default: "key"}}th in-app message displayed",
  "pretext": "{{event_properties.in_app_message_display_type | default: "unknown"}}",
  "color": "good",
  "attachments": [
    {
      "fallback": "fallback",
      "pretext": "Performed {{event_properties.action_type | default: "unknown"}} for {{event_properties.button_text | default:"button name"}}",
      "color": "#0065ff",
      "fields": [
        {
          "title": "[In-App Message Display Notification]",
          "value": "In-app message info is at Hackle 👉 <http://dashboard.hackle.io/in-app-messages/{{event_properties.in_app_message_id}}/|link>",
          "short": false
        }
      ]
    }
  ]
}

Modify the Body as above and save the campaign.

8

Event-based Send Settings

Click the Send Settings button in the webhook campaign.

Select Event-based as the send type.

Set the trigger event to $in_app_action.

To trigger only for a specific in-app message action, use Trigger Event > Add Filter.

  • in_app_message_key

  • in_app_message_id

  • in_app_message_display_type

You can apply the desired conditions using these properties.

Event-based send settings
9

Complete

Now click Start to activate the webhook campaign.

Then trigger the $in_app_action event by performing an action such as clicking the close button on the target in-app message.

When the webhook is triggered successfully, the message is sent to Slack.

Message sent successfully

Last updated