I have a php application that has the following code:
<code>$response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($webhook->url, [
'type' => 'message',
'attachments' => [
[
'contentType' => 'application/vnd.microsoft.card.adaptive',
'content' => [
'type' => 'AdaptiveCard',
'body' => [
[
'type' => 'TextBlock',
'size' => 'Medium',
'weight' => 'Bolder',
'text' => 'New Ticket: ' . $requesterName,
'color' => 'Accent',
'wrap' => true,
'spacing' => 'Small'
],
[
'type' => 'ColumnSet',
'columns' => [
[
'type' => 'Column',
'width' => 'stretch',
'items' => [
[
'type' => 'TextBlock',
'size' => 'Default',
'weight' => 'Bolder',
'text' => $ticket['subject'],
'spacing' => 'Small',
'wrap' => true
]
]
],
[
'type' => 'Column',
'width' => 'auto',
'items' => [
[
'type' => 'TextBlock',
'text' => '(P' . (5 - $ticket['priority']) . ')',
'color' => $ticket['priority'] == 4 ? 'Attention' : 'Good',
'spacing' => 'None'
]
]
]
],
'spacing' => 'Small'
],
[
'type' => 'TextBlock',
'text' => $ticket['description_text'],
'wrap' => true,
'spacing' => 'Small',
'color' => 'Default',
'id' => 'description',
'isVisible' => false
],
[
'type' => 'ActionSet',
'actions' => [
[
'type' => 'Action.OpenUrl',
'title' => 'View Ticket',
'url' => $endpoint . $ticket['id'],
'style' => 'positive'
],
[
'type' => 'Action.ToggleVisibility',
'title' => 'Show Description',
'targetElements' => ['description']
]
],
'spacing' => 'Small'
]
],
'$schema' => 'http://adaptivecards.io/schemas/adaptive-card.json',
'version' => '1.2'
]
]
]
]);
</code>
<code>$response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($webhook->url, [
'type' => 'message',
'attachments' => [
[
'contentType' => 'application/vnd.microsoft.card.adaptive',
'content' => [
'type' => 'AdaptiveCard',
'body' => [
[
'type' => 'TextBlock',
'size' => 'Medium',
'weight' => 'Bolder',
'text' => 'New Ticket: ' . $requesterName,
'color' => 'Accent',
'wrap' => true,
'spacing' => 'Small'
],
[
'type' => 'ColumnSet',
'columns' => [
[
'type' => 'Column',
'width' => 'stretch',
'items' => [
[
'type' => 'TextBlock',
'size' => 'Default',
'weight' => 'Bolder',
'text' => $ticket['subject'],
'spacing' => 'Small',
'wrap' => true
]
]
],
[
'type' => 'Column',
'width' => 'auto',
'items' => [
[
'type' => 'TextBlock',
'text' => '(P' . (5 - $ticket['priority']) . ')',
'color' => $ticket['priority'] == 4 ? 'Attention' : 'Good',
'spacing' => 'None'
]
]
]
],
'spacing' => 'Small'
],
[
'type' => 'TextBlock',
'text' => $ticket['description_text'],
'wrap' => true,
'spacing' => 'Small',
'color' => 'Default',
'id' => 'description',
'isVisible' => false
],
[
'type' => 'ActionSet',
'actions' => [
[
'type' => 'Action.OpenUrl',
'title' => 'View Ticket',
'url' => $endpoint . $ticket['id'],
'style' => 'positive'
],
[
'type' => 'Action.ToggleVisibility',
'title' => 'Show Description',
'targetElements' => ['description']
]
],
'spacing' => 'Small'
]
],
'$schema' => 'http://adaptivecards.io/schemas/adaptive-card.json',
'version' => '1.2'
]
]
]
]);
</code>
$response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($webhook->url, [
'type' => 'message',
'attachments' => [
[
'contentType' => 'application/vnd.microsoft.card.adaptive',
'content' => [
'type' => 'AdaptiveCard',
'body' => [
[
'type' => 'TextBlock',
'size' => 'Medium',
'weight' => 'Bolder',
'text' => 'New Ticket: ' . $requesterName,
'color' => 'Accent',
'wrap' => true,
'spacing' => 'Small'
],
[
'type' => 'ColumnSet',
'columns' => [
[
'type' => 'Column',
'width' => 'stretch',
'items' => [
[
'type' => 'TextBlock',
'size' => 'Default',
'weight' => 'Bolder',
'text' => $ticket['subject'],
'spacing' => 'Small',
'wrap' => true
]
]
],
[
'type' => 'Column',
'width' => 'auto',
'items' => [
[
'type' => 'TextBlock',
'text' => '(P' . (5 - $ticket['priority']) . ')',
'color' => $ticket['priority'] == 4 ? 'Attention' : 'Good',
'spacing' => 'None'
]
]
]
],
'spacing' => 'Small'
],
[
'type' => 'TextBlock',
'text' => $ticket['description_text'],
'wrap' => true,
'spacing' => 'Small',
'color' => 'Default',
'id' => 'description',
'isVisible' => false
],
[
'type' => 'ActionSet',
'actions' => [
[
'type' => 'Action.OpenUrl',
'title' => 'View Ticket',
'url' => $endpoint . $ticket['id'],
'style' => 'positive'
],
[
'type' => 'Action.ToggleVisibility',
'title' => 'Show Description',
'targetElements' => ['description']
]
],
'spacing' => 'Small'
]
],
'$schema' => 'http://adaptivecards.io/schemas/adaptive-card.json',
'version' => '1.2'
]
]
]
]);
This all works fine but i also want to tag either the team or the channel so users get a notification when it posts.
I tired this to test but it just comes with <at>channel</at>
in the message on teams, and is not tagged.
<code> $response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($webhook->url, [
'type' => 'message',
'text' => '<at>channel</at>', // Mention the channel here
'attachments' => [
[
'contentType' => 'application/vnd.microsoft.card.adaptive',
'content' => [
'type' => 'AdaptiveCard',
'$schema' => 'http://adaptivecards.io/schemas/adaptive-card.json',
'version' => '1.0',
'body' => [
[
'type' => 'TextBlock',
'text' => 'This is a message with an Adaptive Card and a mention.',
],
],
],
],
],
'msteams' => [
'entities' => [
[
'type' => 'mention',
'text' => '<at>channel</at>',
'mentioned' => [
'id' => $webhook->channel_id,
'name' => 'channel',
],
],
],
],
]);
</code>
<code> $response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($webhook->url, [
'type' => 'message',
'text' => '<at>channel</at>', // Mention the channel here
'attachments' => [
[
'contentType' => 'application/vnd.microsoft.card.adaptive',
'content' => [
'type' => 'AdaptiveCard',
'$schema' => 'http://adaptivecards.io/schemas/adaptive-card.json',
'version' => '1.0',
'body' => [
[
'type' => 'TextBlock',
'text' => 'This is a message with an Adaptive Card and a mention.',
],
],
],
],
],
'msteams' => [
'entities' => [
[
'type' => 'mention',
'text' => '<at>channel</at>',
'mentioned' => [
'id' => $webhook->channel_id,
'name' => 'channel',
],
],
],
],
]);
</code>
$response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($webhook->url, [
'type' => 'message',
'text' => '<at>channel</at>', // Mention the channel here
'attachments' => [
[
'contentType' => 'application/vnd.microsoft.card.adaptive',
'content' => [
'type' => 'AdaptiveCard',
'$schema' => 'http://adaptivecards.io/schemas/adaptive-card.json',
'version' => '1.0',
'body' => [
[
'type' => 'TextBlock',
'text' => 'This is a message with an Adaptive Card and a mention.',
],
],
],
],
],
'msteams' => [
'entities' => [
[
'type' => 'mention',
'text' => '<at>channel</at>',
'mentioned' => [
'id' => $webhook->channel_id,
'name' => 'channel',
],
],
],
],
]);
Can any one offer any guidance?