1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # Ferro Notifications
//!
//! Multi-channel notification system for the Ferro framework.
//!
//! Provides a Laravel-inspired notification system with support for:
//! - Mail notifications via SMTP
//! - Database notifications for in-app delivery
//! - Slack webhook notifications
//!
//! ## Example
//!
//! ```rust,ignore
//! use ferro_notifications::{Notification, Notifiable, Channel, MailMessage};
//!
//! // Define a notification
//! struct OrderShipped {
//! order_id: i64,
//! tracking: String,
//! }
//!
//! impl Notification for OrderShipped {
//! fn via(&self) -> Vec<Channel> {
//! vec![Channel::Mail, Channel::Database]
//! }
//!
//! fn to_mail(&self) -> Option<MailMessage> {
//! Some(MailMessage::new()
//! .subject("Your order has shipped!")
//! .body(format!("Tracking: {}", self.tracking)))
//! }
//! }
//!
//! // Make User notifiable
//! struct User {
//! email: String,
//! }
//!
//! impl Notifiable for User {
//! fn route_notification_for(&self, channel: Channel) -> Option<String> {
//! match channel {
//! Channel::Mail => Some(self.email.clone()),
//! _ => None,
//! }
//! }
//! }
//!
//! // Send the notification
//! let user = User { email: "user@example.com".into() };
//! user.notify(OrderShipped {
//! order_id: 123,
//! tracking: "ABC123".into(),
//! }).await?;
//! ```
pub use Channel;
pub use ;
pub use ;
pub use Error;
pub use ;
pub use Notification;
/// Re-export async_trait for convenience.
pub use async_trait;