fix: feedback on teh email users get sent when verifying their discord accounts
This commit is contained in:
parent
44bb40d96d
commit
f046410cdc
1 changed files with 10 additions and 15 deletions
|
@ -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<smtp::response::Response, smtp::Error> {
|
||||
let mail = &email.email;
|
||||
fn send_mail(config: &Config, mail: &str, auth: &str, user: &str) -> Result<smtp::response::Response, smtp::Error> {
|
||||
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,7 +173,8 @@ 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
|
||||
|
||||
|
@ -192,8 +189,6 @@ pub mod link {
|
|||
|
||||
If you have issues please refer to our Computer Society Discord Server:
|
||||
{discord}
|
||||
|
||||
Skynet Team
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue