notification-platform
NotificationPlatform Guide
Sentry's NotificationPlatform is a provider-based system for sending notifications across Email, Slack, Discord, and MS Teams. You define data + template, register it, and the platform handles rendering and delivery per provider.
Glossary
| Concept | Role | Location |
|---|---|---|
NotificationData |
Protocol. Frozen dataclass carrying the payload for a single notification. Must declare a source class variable. |
types.py |
NotificationTemplate |
Abstract class. Converts NotificationData into a NotificationRenderedTemplate. Registered per NotificationSource. |
types.py |
NotificationRenderedTemplate |
Dataclass. Provider-agnostic output: subject, body blocks, actions, chart, footer, optional email paths. | types.py |
NotificationProvider |
Protocol. Knows how to validate a target, pick a renderer, and send the final renderable (Email, Slack, etc.). | provider.py |
NotificationRenderer |
Protocol. Converts a NotificationRenderedTemplate into a provider-specific renderable (HTML email, Slack blocks, etc.). |
renderer.py |
NotificationTarget |
Protocol. Identifies the recipient: email address, channel ID, or DM user ID. Two concrete classes: GenericNotificationTarget (email) and IntegrationNotificationTarget (Slack/Discord/MSTeams). |
target.py |
NotificationService |
Entry point. Orchestrates lookup, rendering, and delivery. Provides has_access(), notify_target(), notify_async(), notify_sync(). |
service.py |
All paths below are relative to src/sentry/notifications/platform/.
Step 1: Determine Your Operation
More from getsentry/sentry
design-system
Guide for using Sentry's layout and text primitives. Use when implementing UI components, layouts, or typography. Enforces use of core components over styled components.
84sentry-security
Sentry-specific security review based on real vulnerability history. Use when reviewing Sentry endpoints, serializers, or views for security issues. Trigger keywords: "sentry security review", "check for IDOR", "access control review", "org scoping", "cross-org", "security audit endpoint".
67generate-migration
Generate Django database migrations for Sentry. Use when creating migrations, adding/removing columns or tables, adding indexes, or resolving migration conflicts.
67sentry-javascript-bugs
Review Sentry React and TypeScript changes for bug patterns drawn from real production issues. Use when reviewing a frontend diff or PR, checking Warden findings, auditing the current branch, reviewing production-error patterns, or looking for common regressions in `static/`.
61generate-frontend-forms
Guide for creating forms using Sentry's new form system. Use when implementing forms, form fields, validation, or auto-save functionality.
61migrate-frontend-forms
Guide for migrating forms from the legacy JsonForm/FormModel system to the new TanStack-based form system.
57