Slack Forward
Format and deliver email alerts to Slack:
- Connect — Check if Slack integration is installed via
search_integrations. If not:
connect({ name: "slack" })to connect via Composio OAuth
- Load config — Read channel mapping from memory (key:
slack_alert_channels)
- Default channel for general alerts
- Per-sender overrides (e.g., billing@vendor.com -> #finance)
- Format — Build a rich Slack message for each alert:
- Header: sender name + urgency badge
- Body: email subject + snippet
- Footer: timestamp + link to full email (if available)
- Use priority-based formatting (red for urgent, yellow for normal)
- Deliver — Send formatted message via
SLACK_SEND_MESSAGEto the appropriate channel - Log — Record delivery to memory for deduplication:
- Store message ID to avoid re-alerting on the same email
- Track delivery count for dashboard metrics
- Batching — If multiple alerts fire at once (>3 in a single check):
- Bundle into a single digest message instead of flooding the channel
- Include count and top-priority items first