pub extern crate actix_web;
pub extern crate bcrypt;
pub extern crate chrono;
+pub extern crate comrak;
pub extern crate dotenv;
pub extern crate jsonwebtoken;
pub extern crate lettre;
pub extern crate lettre_email;
extern crate log;
+pub extern crate openssl;
pub extern crate rand;
pub extern crate regex;
+pub extern crate rss;
pub extern crate serde;
pub extern crate serde_json;
pub extern crate sha2;
to_username: &str,
html: &str,
) -> Result<(), String> {
- let email_config = Settings::get().email.as_ref().ok_or("no_email_setup")?;
+ let email_config = Settings::get().email.ok_or("no_email_setup")?;
let email = Email::builder()
.to((to_email, to_username))
} else {
SmtpClient::new(&email_config.smtp_server, ClientSecurity::None).unwrap()
}
- .hello_name(ClientId::Domain(Settings::get().hostname.to_owned()))
+ .hello_name(ClientId::Domain(Settings::get().hostname))
.smtp_utf8(true)
.authentication_mechanism(Mechanism::Plain)
.connection_reuse(ConnectionReuseParameters::ReuseUnlimited);
)
}
+pub fn markdown_to_html(text: &str) -> String {
+ comrak::markdown_to_html(text, &comrak::ComrakOptions::default())
+}
+
#[cfg(test)]
mod tests {
use crate::{extract_usernames, is_email_regex, remove_slurs, slur_check, slurs_vec_to_str};