You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also find an example with user mentions in our [examples](https://github.com/keephq/keep/tree/main/examples/workflows/keep-teams-adaptive-cards-with-mentions.yaml) folder.
121
+
117
122
<Note>
118
123
The sections parameter is a JSON string that follows the Adaptive Cards schema, but can also be an object.
119
124
If it's a string, it will be parsed as a JSON string.
@@ -159,6 +164,71 @@ provider.notify(
159
164
)
160
165
```
161
166
167
+
### Using User Mentions in Adaptive Cards
168
+
169
+
You can mention users in your Adaptive Cards using the `mentions` parameter. The text in your card should include the mention in the format `<at>User Name</at>`, and you need to provide the user's ID and name in the `mentions` parameter.
170
+
171
+
Teams supports three types of user IDs for mentions:
172
+
- Teams User ID (format: `29:1234...`)
173
+
- Microsoft Entra Object ID (format: `49c4641c-ab91-4248-aebb-6a7de286397b`)
174
+
- User Principal Name (UPN) (format: `user@example.com`)
175
+
176
+
```python
177
+
provider.notify(
178
+
typeCard="message",
179
+
sections=[
180
+
{
181
+
"type": "TextBlock",
182
+
"text": "Hello <at>John Doe</at>, please review this alert!"
183
+
}
184
+
],
185
+
mentions=[
186
+
{
187
+
"id": "john.doe@example.com", # Can be UPN, Microsoft Entra Object ID, or Teams User ID
188
+
"name": "John Doe"
189
+
}
190
+
]
191
+
)
192
+
```
193
+
194
+
You can also mention multiple users in a single card:
195
+
196
+
```python
197
+
provider.notify(
198
+
typeCard="message",
199
+
sections=[
200
+
{
201
+
"type": "TextBlock",
202
+
"text": "Hello <at>John Doe</at> and <at>Jane Smith</at>, please review this alert!"
203
+
}
204
+
],
205
+
mentions=[
206
+
{
207
+
"id": "john.doe@example.com",
208
+
"name": "John Doe"
209
+
},
210
+
{
211
+
"id": "49c4641c-ab91-4248-aebb-6a7de286397b", # Microsoft Entra Object ID
212
+
"name": "Jane Smith"
213
+
}
214
+
]
215
+
)
216
+
```
217
+
218
+
In YAML workflows, you can provide the mentions as a JSON string:
Copy file name to clipboardExpand all lines: docs/snippets/providers/teams-snippet-autogenerated.mdx
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
{/* This snippet is automatically generated using scripts/docs_render_provider_snippets.py
1
+
{/* This snippet is automatically generated using scripts/docs_render_provider_snippets.py
2
2
Do not edit it manually, as it will be overwritten */}
3
3
4
4
## Authentication
@@ -25,11 +25,14 @@ actions:
25
25
sections: {value} # For MessageCard: Array of custom information sections. For Adaptive Cards: Array of card elements following the Adaptive Card schema. Can be provided as a JSON string or array.
26
26
schema: {value} # Schema URL for Adaptive Cards. Default is "http://adaptivecards.io/schemas/adaptive-card.json"
27
27
attachments: {value} # Custom attachments array for Adaptive Cards (overrides default attachment structure). Can be provided as a JSON string or array.
28
+
mentions: {value} # List of user mentions to include in the Adaptive Card. Each mention should be a dict with 'id' (user ID, Microsoft Entra Object ID, or UPN) and 'name' (display name) keys.
0 commit comments