ITLab.Template.DevPack.Notifications.MicrosoftTeams
Provides Microsoft Teams notification message models based on Adaptive Cards.
Componentes
| Tipo | Nome | Responsabilidade |
|---|---|---|
| Class | AdaptiveCard | Adaptive Card payload model following the Adaptive Cards schema |
| Class | MicrosoftTeamsMessage | Wraps an AdaptiveCard with an optional recipient email for direct message delivery |
Como usar
// Build an Adaptive Card and wrap it for delivery.
var card = new AdaptiveCard
{
Body = new[] { new TextBlock { Text = "Order 12345 has been approved." } }
};
var message = new MicrosoftTeamsMessage(card, recipientEmail: "approver@company.com");
await teamsNotificationService.SendAsync(message, cancellationToken);
O que não fazer
- Do not embed HTML in
AdaptiveCardtext blocks — Teams renders Adaptive Card markdown only. - Do not set
recipientEmailfor channel posts; leave itnulland configure the channel webhook in the delivery service.
Extensão pelo produto
- Products can extend
AdaptiveCardwith typedBodyelement builders to avoid ad-hoc anonymous-object construction.