Coverage for notifications/senders.py: 100.00%
6 statements
« prev ^ index » next coverage.py v7.10.6, created at 2026-11-30 18:21 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2026-11-30 18:21 +0000
1"""Single entry point for sending text to a (platform, destination).
3The notification subsystem's only outbound IO path. Platform behavior lives in
4the adapters; this delegates so callers that hold a platform id need no more.
5Errors are raised to the caller (dispatcher, alerts, API test-send), which
6decides what to log or surface; adapters make them safe to log.
8Destination values are never logged by these helpers.
9"""
11from __future__ import annotations
13from notifications.adapters.base import DeliveryResult, NotificationConfigError
14from notifications.registry import get_adapter
16__all__ = ["NotificationConfigError", "send_to"]
19def send_to(platform: str, destination: str, content: str) -> DeliveryResult:
20 """Deliver `content` to a single (platform, destination)."""
21 return get_adapter(platform).send(destination, content)