What we are trying to do
I am working on automation which posts messages to a Slack channel using Incoming Webhooks on a custom Slack App. The messages mentions people.
What works
We can send a message just fine, it has formatted content, and usernames are correctly resolved using the link-names flag.
What isn't working
The whole point of the notification is to inform a dynamic set of people about something they should care about. The set of people we tag varies hugely (think people who contributed to a pull request) and so not all possible recipients are in the channel these automated messages go to.
We assumed that given the usernames are being directly @-mentioned, they would be notified by Slack. However, two of the users we've tested with and @-mentioned confirm they never received a notification they had been tagged.
This is different to "human" behaviour, where if you @-mention someone in Slack, you get a little message reminding you that person isn't in this channel and offers to invite them or let them know.
As far as we can tell, sending the message programmatically is doing the equivalent of "Do nothing" in the picture above. I want to do either of the other two options, preferably "Let them know".
How can I notify people they've been mentioned? I've looked at all the API documentation and nothing discusses notifying users who aren't in the channel that they are mentioned.
This can't be an uncommon issue.... right?
Notes:
chat.postMessage
, it's just the only documentation on link_names I could find to link to. We are using Incoming Webhooks, which has minimal documentation on the parameters - it seems to be the same as chat.postMessage
.Slack Connect allows you to work with people outside your company in channels and direct messages (DMs). By moving conversations out of emails, you can work securely and collaboratively with partners, vendors, or customers. Read on for an overview of Slack Connect.
Use @channel to let everyone in a channel know about timely, relevant information. This will trigger a desktop or mobile notification for all members of the channel, whether their availability is set to active or away.
Type: @general to message everyone in the general channel. @team to notify everyone on that team. @channel to message everyone in that channel.
You need to invite the user to the channel first, using the Python client that's:
client.channels_invite(
channel=channel_id,
user=user_id
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With