Mentioning users via slack in webhooks

Viewed 9728

I'm building somewhat integration github with slack, which will notify users (reviewers of pull request) and send them link in #general chat.

And I'm struggling with mentioning users, right now I found only one way to mention them: via username in Slack, however to know this username, I must ask person to give it to me. Mentioning via <@display_name> doesn't seem to work, even with link_names: 1 parameter.

1 Answers

You can mention users through <@memberID> as text in the Slack webhook. This will post a username as a string.

For example, if there is a user named John with memberID UC6B12Z4N, then pass <@UC6B12Z4N> in the Slack webhook. This will mention @John with the correct link.

How to find my Member ID in Slack workspace?

Related