ITLab.Template.DevPack.Notifications.Slack
Provides Slack notification message models for block-based message composition.
Componentes
| Tipo | Nome | Responsabilidade |
|---|---|---|
| Class | SlackMessage | Represents a Slack message with text and optional Block Kit blocks |
Como usar
// Build and dispatch a Slack notification.
var message = new SlackMessage
{
Text = "Order 12345 approved.",
Blocks = SlackBlockBuilder.Section("Order *12345* has been approved.").Build()
};
await slackNotificationService.SendAsync(message, cancellationToken);
O que não fazer
- Do not include auth tokens or webhook URLs inside
SlackMessage— those belong in configuration. - Do not exceed Slack's block limit (50 blocks per message) when building dynamic payloads.
Extensão pelo produto
- Products can build typed block builders on top of
SlackMessageto enforce consistent message structure.