Custom @mentions + Slack notifications with Comment Thread component?

We’re using the Comment Thread component and want to support custom @mentions that send a Slack DM to mentioned users (multiple mentions supported).

However, it looks like the component doesn’t expose an event for “on comment post”, so we can’t intercept the submit to:

  • Parse and validate mentions
  • Trigger Slack notifications
  • Handle errors cleanly

Has anyone implemented custom mentions + Slack notifications with the Comment Thread component?

Is there a supported way to hook into the post event, or is the recommended approach to disable the built-in composer and build a custom one inside a module?

Would appreciate guidance or patterns others have used :folded_hands:

1 Like

Hey @Anna123NW

Yes, you can do this with the Comment Thread component

For Slack mentions, you just need to include the user’s Slack ID in the message like this:

<@U12345678>

If there are multiple mentions, just include multiple IDs in the same message:

<@U12345678> <@U87654321>

Slack will handle the notifications automatically.

On the Retool side, add an event handler to the Comment Thread component for the Submit event, and trigger your Slack query from there. In that query, parse the comment text, replace the mentions with the proper <@SlackID> format, and send it to Slack.

That’s really all you need.

Here’s a sample setup for reference:


Feel free to ask if you need further assistance or have additional questions. We're here to help!

3 Likes

yeah! i also used cached slack users.list list API to search for the users’ memberID. So in comment thread it’s possible to tag @name.surname or @slackDisplayName. The only drawback it that not possible to style “@name” in commentThread.value :frowning:

but it works! thanks :slight_smile:

1 Like

@Anna123NW

You’re right — the Comment Thread component doesn’t currently support tagging @mentions directly inside commentThread.value. That’s just a limitation of the component right now.

Also, if you need a user’s Slack member ID, you can get it directly from Slack:

Go to the user’s profile → click More (three dots) → and copy the Member ID from there.

thanks! :slight_smile: i need to search for them dynamically :slight_smile: users need to have them out of the box.

1 Like