0

Can text in a Slack event template be formatted to mention specific Slack users?

We would like to configure some of our Slack notifications so that they send to specific channels *and* mention some of our teammates. Right now, including "@tom" in an event template will include "@tom" as a string in the Slack notification, but we'd like "@tom" to arrive as a Slack mention.

 

Thanks very much for your help!

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi there,

     

    I spent a lot of time on this question and it doesn't seem like it's possible. I think the reason is that Slack names in '@' metions need to be chosen from a drop-down offered by Slack. I don't think they allow for a string sent to them to be counted as a mention. There seems to be some additional logic happening behind the scenes that I don't have insight on. You might be able to get in touch with Slack directly to get a better answer here, but it doesn't seem like it can be done, at least via Segment. It looks like we'll send a string here and I wouldn't know what other data structure Slack would be looking for to make this happen. We use Handlebars expressions to format Slack messages so you could bring that up if you do decide to reach out to them. 

     

    Good luck with this and it would be awesome to hear if you figure something out with it on your end!

     

    Best,
    Spencer
    Success Engineer | Segment

    Reply Upvote
  • Thank you, Spencer! Yeah, there must be a way... Zapier allows you to mention individuals by putting <! > around the person you want to notify. For example, @tom is formatted <!tom> and seems to work ( https://zapier.com/help/slack/#slack-announcements ). Does Slack manage the configuration of its integration with Segment or do you do that? Thanks again for providing a thorough reply.

    Reply Upvote
  • Hi,

     

    That's interesting! I tried every combination I could think of using <!NAME>, but I couldn't get it to work. I think the limitation here might be the capabilities of the Handlebars library in this context. We own the integration code with Slack, but essentially all it does is to compile the templates you create in the settings with Handlebars. There is no additional logic around template formatting. I'm sorry I don't have a better answer for you!

     

    Best,
    Spencer
    Success Engineer | Segment

    Reply Upvote
  • Ok, no problem. Thanks for looking into this.

    Reply Upvote
reply to topic