Expand description
SMS and push notification channels (Symfony Notifier shaped).
Types: Notification, Channel, SmsMessage, PushMessage.
Transports: NullTransport, MemoryTransport, SmsOnlyTransport.
DI: RegisterDefaultNotifierPass seeds DEFAULT_NOTIFIER_SERVICE.
§Examples
use serenade_notifier::{MemoryTransport, Notification, Transport};
let transport = MemoryTransport::new();
transport.send(&Notification::sms("+15551212", "hello"))?;
assert_eq!(transport.sent().len(), 1);Structs§
- Memory
Transport - Records every successful send for inspection in tests and local apps.
- Notifier
Service - Newtype so transport trait objects can be stored in the container.
- Null
Transport - Discards every notification after validation (Symfony
NullTransportanalogue). - Push
Message - Push payload (device token + title + body).
- Register
Default Notifier Pass - Seeds
DEFAULT_NOTIFIER_SERVICEwith aNullTransportwhen missing. - SmsMessage
- SMS payload (phone + body).
- SmsOnly
Transport - Rejects push; accepts SMS (useful when only an SMS vendor is wired).
Enums§
- Channel
- Delivery channel for a
crate::Notification. - Notification
- Outgoing notification before a transport sends it.
- Notifier
Error - Failure while building or sending a notification.
Constants§
- DEFAULT_
NOTIFIER_ SERVICE - Container id of the default notifier when registered by the pass.
- NOTIFIER_
TRANSPORT_ TAG - Service tag applied to notifier transport definitions.
Traits§
- Transport
- Sends a
Notificationsynchronously.
Functions§
- version
- Compile-time crate version for diagnostics.