From f1ee2f15141e255d58764d17d333188df5d0ee12 Mon Sep 17 00:00:00 2001 From: georgelgeback Date: Sun, 10 May 2026 11:48:58 +0000 Subject: [PATCH 1/3] Fix some errors in emails, fixed bug where email would be sent to wrong adress --- mailer/bilf-mail-council.html | 6 +++--- mailer/bilf-mail-private.html | 4 ++-- mailer/email-changed-mail.html | 8 ++++---- mailer/email_changed_mailer.py | 4 ++-- mailer/nomination-mail.html | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mailer/bilf-mail-council.html b/mailer/bilf-mail-council.html index 6f39aa4..00fe63a 100644 --- a/mailer/bilf-mail-council.html +++ b/mailer/bilf-mail-council.html @@ -24,7 +24,7 @@

Hej Bilf!,

En ny kollegie-bilbokning har gjorts!

-

F-älgen är bokad av {{ booking.name }} från {{ booking.council_sv }} den {{ booking.date }} klockan {{ booking.time }}. Detta bör hantera sig självt men vi tänkte att du kanske vill veta./p> +

F-älgen är bokad av {{ booking.name }} från {{ booking.council_sv }} den {{ booking.date }} klockan {{ booking.time }}. Detta bör hantera sig självt men vi tänkte att du kanske vill veta.

Med Vänliga hälsningar,
De små tomtarna som sitter i sektionens SMTP-server och matar brevduvorna

@@ -49,9 +49,9 @@

Hello BilF!,

A new council booking has been made!

-

The car is booked by {{ booking.name }} from {{ booking.council_en }} on {{ booking.date }} at {{ booking.time}}. It should handle itself but we though you migh want to know.

+

The car is booked by {{ booking.name }} from {{ booking.council_en }} on {{ booking.date }} at {{ booking.time }}. It should handle itself but we though you might want to know.

Best regards,
- The little gnomes that inhabit the guilds SMTP server and feed the carrier pidgeons

+ The little gnomes that inhabit the guild's SMTP server and feed the carrier pidgeons

diff --git a/mailer/bilf-mail-private.html b/mailer/bilf-mail-private.html index 8bf565a..0c4af9b 100644 --- a/mailer/bilf-mail-private.html +++ b/mailer/bilf-mail-private.html @@ -49,9 +49,9 @@

Hello BilF!,

A new PRIVATE booking has been made!

-

The car is booked by {{ booking.name }} on {{ booking.date }} at {{ booking.time}}. TAKE CARE OF IT!

+

The car is booked by {{ booking.name }} on {{ booking.date }} at {{ booking.time }}. TAKE CARE OF IT!

Best regards,
- The little gnomes that inhabit the guilds SMTP server and feed the carrier pidgeons

+ The little gnomes that inhabit the guild's SMTP server and feed the carrier pidgeons

diff --git a/mailer/email-changed-mail.html b/mailer/email-changed-mail.html index 32997bd..f1203c1 100644 --- a/mailer/email-changed-mail.html +++ b/mailer/email-changed-mail.html @@ -26,8 +26,8 @@

E-postadressen för ditt F-sektionen inom TLTH konto har ändrats till {{ new_email_masked }}.

-

🚨 Var detta inte du?

-

Om du inte ändrade din e-postadress själv, kontakta vårt supportteam omedelbart.

+

Var detta inte du?

+

Om du inte ändrade din e-postadress själv, kontakta oss på mejladressen nedan omedelbart.

Du kommer inte längre att få meddelanden på denna e-postadress.

@@ -67,8 +67,8 @@

The email address for your the F-Guild at TLTH account has been changed to {{ new_email_masked }}.

-

🚨 Wasn't this you?

-

If you didn't change your email address yourself, contact our support team immediately.

+

Was this not you?

+

If you didn't change your email address yourself, contact our support team at the email adress below immediately.

You will no longer receive notifications at this email address.

diff --git a/mailer/email_changed_mailer.py b/mailer/email_changed_mailer.py index c1d71bf..a38d6dd 100644 --- a/mailer/email_changed_mailer.py +++ b/mailer/email_changed_mailer.py @@ -6,7 +6,7 @@ STANDARD_SENDER, SUPPORT_LINK, ) -from mailer.mail_core import send_mail +from mailer.mail_core import send_mail_to_address from db_models.user_model import User_DB import html as python_html @@ -41,4 +41,4 @@ def email_changed_mailer(user: User_DB, new_email: str, old_email: str): msg["To"] = old_email msg["Subject"] = EMAIL_CHANGED_SUBJECT - send_mail(user, msg) + send_mail_to_address(old_email, msg) diff --git a/mailer/nomination-mail.html b/mailer/nomination-mail.html index 5df3eb8..888a671 100644 --- a/mailer/nomination-mail.html +++ b/mailer/nomination-mail.html @@ -79,7 +79,7 @@

Congratulations {{ user.name }}!

You have been nominated for a council post within the F-Guild!

-

Position: {{ position_name_sv }}

+

Position: {{ position_name_en }}

Someone within the guild has nominated you for this position. The nomination is anonymous and no one can see who nominated you. Only election administrators can see that you have been nominated, and the motivation.

@@ -103,11 +103,11 @@

Important: You must use the same email address ({{ user.email }}) on your account for the nomination to be linked to your candidacy.

Deadline for candidacy submission: {{ deadline_date }}

-

If you have questions about the election or nomination process, contact the Nomination Committée at +

If you have questions about the election or nomination process, contact the Nomination Committee at {{ election_admin_email }}.

Good luck!
- Nomination Committée, F-Guild at TLTH

+ Nomination Committee, F-Guild at TLTH


You are receiving this email because someone has nominated you for a position within the F-Guild. From 46ed3fb45afbcb428a0591e03e196e4c6f49cf8a Mon Sep 17 00:00:00 2001 From: georgelgeback Date: Sun, 10 May 2026 11:51:57 +0000 Subject: [PATCH 2/3] swedish grammar --- mailer/email-changed-mail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailer/email-changed-mail.html b/mailer/email-changed-mail.html index f1203c1..2523948 100644 --- a/mailer/email-changed-mail.html +++ b/mailer/email-changed-mail.html @@ -27,7 +27,7 @@

Var detta inte du?

-

Om du inte ändrade din e-postadress själv, kontakta oss på mejladressen nedan omedelbart.

+

Om du inte ändrade din e-postadress själv, kontakta oss via mejladressen nedan omedelbart.

Du kommer inte längre att få meddelanden på denna e-postadress.

From 16b8b76fa154b1e44f80f73d45138aa741e070b7 Mon Sep 17 00:00:00 2001 From: georgelgeback Date: Sun, 10 May 2026 13:33:22 +0000 Subject: [PATCH 3/3] fix spelling: adress -> address --- mailer/email-changed-mail.html | 2 +- mailer/mail_core.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mailer/email-changed-mail.html b/mailer/email-changed-mail.html index 2523948..ddd7a24 100644 --- a/mailer/email-changed-mail.html +++ b/mailer/email-changed-mail.html @@ -68,7 +68,7 @@

Was this not you?

-

If you didn't change your email address yourself, contact our support team at the email adress below immediately.

+

If you didn't change your email address yourself, contact our support team at the email address below immediately.

You will no longer receive notifications at this email address.

diff --git a/mailer/mail_core.py b/mailer/mail_core.py index 7808402..4aa2d51 100644 --- a/mailer/mail_core.py +++ b/mailer/mail_core.py @@ -25,7 +25,7 @@ def send_mail(user: User_DB, msg: MIMEText): print(f"Failed to send email: {e}") -def send_mail_to_address(adress: EmailStr, msg: MIMEText): +def send_mail_to_address(address: EmailStr, msg: MIMEText): env = os.getenv("ENVIRONMENT") if env != "production" and env != "stage": @@ -36,7 +36,7 @@ def send_mail_to_address(adress: EmailStr, msg: MIMEText): # Create an SMTP session with smtplib.SMTP(SMTP_SERVER, smtplib.SMTP_PORT) as server: server.starttls() - server.sendmail(STANDARD_SENDER, adress, msg.as_string()) - print(f"Email sent successfully to adress {adress}") + server.sendmail(STANDARD_SENDER, address, msg.as_string()) + print(f"Email sent successfully to address {address}") except Exception as e: print(f"Failed to send email: {e}")