Channels/Chat
Microsoft Teams
Post notifications into Teams channels via Incoming Webhooks or Workflow connectors.
Microsoft Teams supports two webhook-style integrations. The classic one (Office 365 Connector) is being deprecated in favor of Workflows / Power Automate. Both work with this driver — the URL shape differs but the payload you produce does not.
Deprecation note
Microsoft announced deprecation of Office 365 Connectors for Teams. New channels should use Workflows (Power Automate). Existing connector URLs continue to work, but won't be the default experience going forward. Check Microsoft's current guidance before committing.
Setup — Workflow (recommended)
- In a Teams channel, click
⋯→ Workflows. - Pick the template "Post to a channel when a webhook request is received".
- Complete the wizard — it generates a webhook URL.
Setup — classic Connector (legacy)
- In a Teams channel, click
⋯→ Connectors. - Add Incoming Webhook.
- Name it, set an icon, copy the URL.
import "github.com/gopackx/go-notification/channel/chat/teams"
notifier.RegisterChannel("teams", teams.New(teams.Config{
WebhookURL: os.Getenv("TEAMS_WEBHOOK_URL"),
}))Sending
Teams messages use an Adaptive Card format. The builder produces one:
func (n DeployStarted) ToTeams(u notification.Notifiable) *teams.Message {
return teams.NewMessage().
Title("Deploy started: " + n.Service).
Text("Environment: " + n.Env).
Fact("Commit", n.Commit).
Fact("Actor", n.Actor).
Action("Open build", n.BuildURL)
}Configuration reference
| Field | Type | Required | Description |
|---|---|---|---|
WebhookURL | string | yes | Teams workflow or connector URL. |
Timeout | time.Duration | no | HTTP timeout per send. Default: 30s. |
Caveats
- No DMs. Webhooks post to channels only. For 1:1 user notifications, use a full Teams bot (not yet supported by this driver).
- Card rendering varies between desktop, web, and mobile Teams clients. Test on each where it matters.
- Rate limiting — Microsoft throttles aggressively above ~4 messages per second per connector. Batch updates.
Troubleshooting
Webhook message delivery failed with error: ...— usually invalid Adaptive Card JSON. Simplify the card to isolate which field breaks rendering.- Messages arrive with wrong title/icon — classic connector settings, not overrideable from the payload. Update in the Teams UI.
- Workflow posts but formatting is plain — the Workflow template may be using "text" mode instead of Adaptive Card. Re-run the wizard and pick the card-capable template.