Coverage for notifications/senders.py: 100.00%

6 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2026-11-30 14:44 +0000

1"""Single entry point for sending text to a (platform, destination). 

2 

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. 

7 

8Destination values are never logged by these helpers. 

9""" 

10 

11from __future__ import annotations 

12 

13from notifications.adapters.base import DeliveryResult, NotificationConfigError 

14from notifications.registry import get_adapter 

15 

16__all__ = ["NotificationConfigError", "send_to"] 

17 

18 

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)