]> Untitled Git - lemmy.git/blobdiff - crates/utils/src/email.rs
Moving settings and secrets to context.
[lemmy.git] / crates / utils / src / email.rs
index 3e5307421b40b54f3a8cf93796963b2eb737423e..77f83d020bcec4ae788c377664a1dc2a604f6b1b 100644 (file)
@@ -18,9 +18,10 @@ pub fn send_email(
   to_email: &str,
   to_username: &str,
   html: &str,
+  settings: &Settings,
 ) -> Result<(), String> {
-  let email_config = Settings::get().email.ok_or("no_email_setup")?;
-  let domain = Settings::get().hostname;
+  let email_config = settings.email.to_owned().ok_or("no_email_setup")?;
+  let domain = settings.hostname.to_owned();
 
   let (smtp_server, smtp_port) = {
     let email_and_port = email_config.smtp_server.split(':').collect::<Vec<&str>>();