# Discourse webhook to Slack

**URL:** <https://community.openfn.org/t/discourse-webhook-to-slack/424>\
**Category:** Job Writing\
**Created:** [April 2, 2024, 2:54pm UTC](https://community.openfn.org/t/discourse-webhook-to-slack/424 "2024-04-02T14:54:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylordowns2000](https://community.openfn.org/user_avatar/community.openfn.org/taylordowns2000/32/165_2.png) [@taylordowns2000](https://community.openfn.org/u/taylordowns2000)\
**Post date:** [April 2, 2024, 2:54pm UTC](https://community.openfn.org/t/discourse-webhook-to-slack/424/1 "2024-04-02T14:54:10Z")

</div>

At OpenFn we wanted to get alerts on Slack whenever new posts came into this forum. Thanks to discourse’s “API → Webhook” feature it took me 2-minutes to automate. Thanks, Discourse, for being awesome.

Here’s my OpenFn job code. I used the `language-http@6.1.0` adaptor:

```js
post(
  'https://hooks.slack.com/services/shhhhhhhhh-secret-slack-hook-URL-here',
  state => ({
    body: {
      "text": `🧑‍🤝‍🧑 New Forum Activity! Let's go be helpful!`,
      "blocks": [
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": `Yay for the community! 🧑‍🤝‍🧑`
          }
        },
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": `*${state.data.topic.created_by.name}* (${state.data.topic.created_by.username}) created a new topic, "<https://community.openfn.org/t/${state.data.topic.id}|${state.data.topic.title}>", let's go help!`
          }
        }
      ]
    }
  })
);

```

---

<div class="post-metadata">

**Author:** ![Cord42](https://community.openfn.org/user_avatar/community.openfn.org/cord42/32/224_2.png) [@Cord42](https://community.openfn.org/u/Cord42)\
**Post date:** [August 23, 2024, 5:22pm UTC](https://community.openfn.org/t/discourse-webhook-to-slack/424/2 "2024-08-23T17:22:16Z")

</div>

Slack seems like a really easy adaptor to make, butt could really help users that are less technical.
