Skip to content

Notification Channel Setup

Notification channels are configured per organization in the notification_channels table. Each channel implements ChannelDelivery in internal/notifications/channels.go.

Email (SMTP / HTTP API)

SMTP Provider

json
{
  "channel_type": "email",
  "configuration": {
    "provider": "smtp",
    "from": "slozy@example.com",
    "to": "team@example.com"
  }
}

Note: SMTP delivery requires implementation — use the api provider for immediate use.

HTTP API Provider

json
{
  "channel_type": "email",
  "configuration": {
    "provider": "api",
    "api_endpoint": "https://api.sendgrid.com/v3/mail/send",
    "api_key": "SG.xxxxx",
    "from": "slozy@example.com",
    "to": "team@example.com"
  }
}

The API provider sends a POST with the notification payload and supports Bearer token authentication.

Slack Webhook

json
{
  "channel_type": "slack",
  "configuration": {
    "webhook_url": "https://hooks.slack.com/services/T00/B00/xxxxx"
  }
}

Slack messages use structured attachments with color-coded urgency:

  • Critical → red (#dc3545)
  • High → orange (#fd7e14)
  • Medium → yellow (#ffc107)
  • Low → green (#28a745)

Each message includes status, priority, SLO ID, alert type, and optional metadata fields.

Telegram Bot

json
{
  "channel_type": "telegram",
  "configuration": {
    "bot_token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
    "chat_id": "-1001234567890"
  }
}

Telegram messages are sent via the Bot API (sendMessage) with Markdown formatting. Requires bot_token (from @BotFather) and chat_id (chat/group ID).

Mattermost Webhook

json
{
  "channel_type": "mattermost",
  "configuration": {
    "webhook_url": "https://mattermost.example.com/hooks/xxx",
    "username": "SLOzy Bot",
    "channel": "~town-square"
  }
}

Mattermost uses incoming webhooks (similar to Slack). The username and channel fields are optional — if omitted, the webhook defaults from Mattermost are used.

Generic Webhook

json
{
  "channel_type": "webhook",
  "configuration": {
    "webhook_url": "https://hooks.example.com/alerts",
    "api_key": "optional-bearer-token",
    "headers": "{\"X-Custom\": \"value\"}"
  }
}

The webhook channel POSTs a JSON payload with all notification fields. Custom headers are supported via the headers config field as a JSON string map.

Validation

Each channel has a Validate() method — required fields are enforced at creation time. For example, email requires to and from, webhook requires webhook_url, Slack requires webhook_url.