Search code examples
gogitlabslack

Slack mentions in golang templates


I am using go gitlab package to fetch users from gitlab. While trying to tag a person in slack in my go template using the following syntax @{{.Name}} , Slack receives a string @Foo Bar, but the person is not actually being tagged. Are there any workarounds available? Here's the screenshot of slack output


Solution

  • Based on the details mentioned in the question.

    You are using @{{.Name}}.

    @SlackId should be used to tag a user instead of @UserName

    To tag a user for mentions, you will need their Slack ID