Dashboard subscribers widget
This commit is contained in:
21
src/domain/subscribers.rs
Normal file
21
src/domain/subscribers.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct SubscriberEntry {
|
||||
pub id: Uuid,
|
||||
pub email: String,
|
||||
pub subscribed_at: DateTime<Utc>,
|
||||
pub status: String,
|
||||
pub unsubscribe_token: Option<String>,
|
||||
}
|
||||
|
||||
impl SubscriberEntry {
|
||||
pub fn confirmed(&self) -> bool {
|
||||
self.status == "confirmed"
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn formatted_date(&self) -> String {
|
||||
self.subscribed_at.format("%B %d, %Y").to_string()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user