User gets a notification of the mention:
(click to zoom)
Other users are able to contact the user directly from the mention in the card:
(click to zoom)
Checkout the announcement if you haven't already: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cconnector-html#mention-support-within-adaptive-cards-v12
In the docs, there is a great example of the JSON we need to send to Teams
to post the card containing the mention. So in this post, lets see how we
can do this when using the Bot Framework .NET Core SDK:
For this code to work, we will need the following Nuget packages:
Quick note: I noticed that the user mentioned is only notified when the
Adaptive card is first created. If you update the same adaptive card later
and mention the same user again, they are not notified. This is probably for
the best as the Adaptive card might be updated several times and if you got
a notification every time, it might be really annoying to the user.
Hope you found this post useful!
1 comment:
Thanks for the nice article.
I am able to see mentions in the channel but I couldn't get the notification for the user mentioned.
payload:
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "Test message tagging"
},
{
"type": "TextBlock",
"text": "Hi Yeswanth Kota "
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"msteams": {
"entities": [
{
"type": "mention",
"text": "Yeswanth Kota",
"mentioned": {
"id": "yeswanth.xxx@xxxx.com",
"name": "Yeswanth Kota"
}
}
]
}
}
}
]
}
Post a Comment