Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit d3a810a

Browse files
committed
Rename witathon email references
1 parent 5e40651 commit d3a810a

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/backend/src/data/mail.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::collections::HashMap;
22

3+
use bhw_types::common_data::EVENT_NAME;
34
use mailgun_rs::{EmailAddress, Mailgun, MailgunRegion, Message};
45

56
use crate::app_config::AppConfig;
@@ -49,7 +50,7 @@ impl Mailer {
4950
};
5051

5152
let client = self.mailgun();
52-
let from = EmailAddress::name_address("WiTathon", "no-reply@hack.bathcs.com");
53+
let from = EmailAddress::name_address(EVENT_NAME, "no-reply@hack.bathcs.com");
5354

5455
client.async_send(MailgunRegion::EU, &from, message).await?;
5556
Ok(())

packages/backend/src/models/password_reset.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::collections::HashMap;
22

33
use bhw_models::{password_reset, prelude::*, website_user};
4+
use bhw_types::common_data::EVENT_NAME;
45
use chrono::{Duration, Utc};
56
use rand::{
67
distr::{Alphanumeric, SampleString},
@@ -111,7 +112,7 @@ impl PasswordResetHelper {
111112
to: email_address(to_username),
112113
vars: mail_vars,
113114
template_key: "bhw-password-reset".to_string(),
114-
subject: "Reset your WiTathon password".to_string(),
115+
subject: format!("Reset your {} password", EVENT_NAME),
115116
})
116117
.await?;
117118
Ok(())

packages/backend/src/models/signup_requests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::util::email_address::email_address;
77
use crate::util::passwords::PasswordManager;
88
use bhw_models::prelude::*;
99
use bhw_models::signup_request;
10+
use bhw_types::common_data::EVENT_NAME;
1011
use chrono::Duration;
1112
use chrono::Utc;
1213
use sea_orm::{
@@ -170,7 +171,7 @@ impl SignupRequestHelper {
170171

171172
let instruction = SendInstruction {
172173
to: Self::email_address(signup_request),
173-
subject: "Welcome to WiTathon!".to_string(),
174+
subject: format!("Welcome to {}!", EVENT_NAME),
174175
template_key: "bhw-welcome".to_string(),
175176
vars: mail_vars,
176177
};
@@ -186,7 +187,7 @@ impl SignupRequestHelper {
186187

187188
let instruction = SendInstruction {
188189
to: Self::email_address(signup_request),
189-
subject: "Welcome to WiTathon!".to_string(),
190+
subject: format!("Welcome to {}!", EVENT_NAME),
190191
template_key: "bhw-welcome-noverify".to_string(),
191192
vars: HashMap::new(),
192193
};

0 commit comments

Comments
 (0)