Implemented mail notifications.
This commit is contained in:
+50
-1
@@ -51,12 +51,58 @@ impl Database {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub enum MailTransport {
|
||||
Smtp,
|
||||
File
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct Mailing {
|
||||
transport: MailTransport,
|
||||
from: String,
|
||||
path: Option<String>,
|
||||
server: Option<String>,
|
||||
user: Option<String>,
|
||||
password: Option<String>,
|
||||
tls: Option<bool>
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
impl Mailing {
|
||||
pub fn transport(&self) -> &MailTransport {
|
||||
&self.transport
|
||||
}
|
||||
pub fn from(&self) -> &str {
|
||||
&self.from
|
||||
}
|
||||
pub fn path(&self) -> &Option<String> {
|
||||
&self.path
|
||||
}
|
||||
pub fn server(&self) -> &Option<String> {
|
||||
&self.server
|
||||
}
|
||||
pub fn user(&self) -> &Option<String> {
|
||||
&self.user
|
||||
}
|
||||
pub fn password(&self) -> &Option<String> {
|
||||
&self.password
|
||||
}
|
||||
pub fn tls(&self) -> Option<bool> {
|
||||
self.tls
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
#[derive(Deserialize)]
|
||||
pub struct Configuration {
|
||||
session: Session,
|
||||
network: Network,
|
||||
database: Database
|
||||
database: Database,
|
||||
mailing: Mailing
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
@@ -70,6 +116,9 @@ impl Configuration {
|
||||
pub fn database(&self) -> &Database {
|
||||
&self.database
|
||||
}
|
||||
pub fn mailing(&self) -> &Mailing {
|
||||
&self.mailing
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
|
||||
Reference in New Issue
Block a user