diff --git a/src/commands/link_email.rs b/src/commands/link_email.rs index 44001d3..71cfbb0 100644 --- a/src/commands/link_email.rs +++ b/src/commands/link_email.rs @@ -87,7 +87,7 @@ pub mod link { // generate a auth key let auth = random_string(20); - match send_mail(&config, &details, &auth, &command.user.name) { + match send_mail(&config, &details.email, &auth, &command.user.name) { Ok(_) => match save_to_db(&db, &details, &auth, &command.user.id).await { Ok(_) => {} Err(e) => { @@ -136,23 +136,22 @@ pub mod link { .ok() } - fn send_mail(config: &Config, email: &Wolves, auth: &str, user: &str) -> Result { - let mail = &email.email; + fn send_mail(config: &Config, mail: &str, auth: &str, user: &str) -> Result { let discord = "https://computer.discord.skynet.ie"; let sender = format!("UL Computer Society <{}>", &config.mail_user); // Create the html we want to send. let html = html! { head { - title { "Hello from Skynet!" } + title { "UL Wolves Discord Linker" } style type="text/css" { "h2, h4 { font-family: Arial, Helvetica, sans-serif; }" } } div { - h2 { "Hello from Skynet!" } + h2 { "UL Wolves Discord Linker" } - h3 { "Link your Account" } + h3 { "Link your UL Wolves Account to Discord" } // Substitute in the name of our recipient. p { "Hi " (user) "," } p { @@ -166,9 +165,6 @@ pub mod link { "If you have issues please refer to our Computer Society Discord Server:" br; a href=(discord) { (discord) } - } - p { - "Skynet Team" br; "UL Computer Society" } @@ -177,8 +173,9 @@ pub mod link { let body_text = format!( r#" - Hello from Skynet! - + UL Wolves Discord Linker + Link your UL Wolves Account to Discord + Link your Account Hi {user}, @@ -192,9 +189,7 @@ pub mod link { If you have issues please refer to our Computer Society Discord Server: {discord} - - Skynet Team - UL Computer Society + UL Computer Society "# ); @@ -202,7 +197,7 @@ pub mod link { let email = Message::builder() .from(sender.parse().unwrap()) .to(mail.parse().unwrap()) - .subject("Skynet-Discord: Link Wolves.") + .subject("Skynet: Link Discord to Wolves.") .multipart( // This is composed of two parts. // also helps not trip spam settings (uneven number of url's