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