Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mailer/bilf-mail-council.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<td align="center">
<p>Hej Bilf!,</p>
<p>En ny kollegie-bilbokning har gjorts!</p>
<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./p>
<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.</p>
<p>Med Vänliga hälsningar,<br>
De små tomtarna som sitter i sektionens SMTP-server och matar brevduvorna</p>
</td>
Expand All @@ -49,9 +49,9 @@
<td align="center">
<p>Hello BilF!,</p>
<p>A new council booking has been made!</p>
<p>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.</p>
<p>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.</p>
<p>Best regards,<br>
The little gnomes that inhabit the guilds SMTP server and feed the carrier pidgeons</p>
The little gnomes that inhabit the guild's SMTP server and feed the carrier pidgeons</p>
</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions mailer/bilf-mail-private.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
<td align="center">
<p>Hello BilF!,</p>
<p>A new <strong>PRIVATE</strong> booking has been made!</p>
<p>The car is booked by {{ booking.name }} on {{ booking.date }} at {{ booking.time}}. TAKE CARE OF IT!</p>
<p>The car is booked by {{ booking.name }} on {{ booking.date }} at {{ booking.time }}. TAKE CARE OF IT!</p>
<p>Best regards,<br>
The little gnomes that inhabit the guilds SMTP server and feed the carrier pidgeons</p>
The little gnomes that inhabit the guild's SMTP server and feed the carrier pidgeons</p>
</td>
</tr>
</table>
Expand Down
8 changes: 4 additions & 4 deletions mailer/email-changed-mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<p>E-postadressen för ditt <strong>F-sektionen inom TLTH</strong> konto har ändrats till {{ new_email_masked }}.</p>

<div style="background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px; padding: 15px; margin: 20px 0;">
<p style="margin: 0; color: #721c24;"><strong>🚨 Var detta inte du?</strong></p>
<p style="margin: 10px 0 0 0; color: #721c24;">Om du inte ändrade din e-postadress själv, kontakta vårt supportteam omedelbart.</p>
<p style="margin: 0; color: #721c24;"><strong>Var detta inte du?</strong></p>
<p style="margin: 10px 0 0 0; color: #721c24;">Om du inte ändrade din e-postadress själv, kontakta oss via mejladressen nedan omedelbart.</p>
</div>

<p>Du kommer inte längre att få meddelanden på denna e-postadress.</p>
Expand Down Expand Up @@ -67,8 +67,8 @@
<p>The email address for your <strong>the F-Guild at TLTH</strong> account has been changed to {{ new_email_masked }}.</p>

<div style="background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px; padding: 15px; margin: 20px 0;">
<p style="margin: 0; color: #721c24;"><strong>🚨 Wasn't this you?</strong></p>
<p style="margin: 10px 0 0 0; color: #721c24;">If you didn't change your email address yourself, contact our support team immediately.</p>
<p style="margin: 0; color: #721c24;"><strong>Was this not you?</strong></p>
<p style="margin: 10px 0 0 0; color: #721c24;">If you didn't change your email address yourself, contact our support team at the email address below immediately.</p>
</div>

<p>You will no longer receive notifications at this email address.</p>
Expand Down
4 changes: 2 additions & 2 deletions mailer/email_changed_mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
6 changes: 3 additions & 3 deletions mailer/mail_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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}")
6 changes: 3 additions & 3 deletions mailer/nomination-mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<td align="center">
<p><strong>Congratulations {{ user.name }}!</strong></p>
<p>You have been <strong>nominated for a council post</strong> within the F-Guild!</p>
<p><strong>Position:</strong> {{ position_name_sv }}</p>
<p><strong>Position:</strong> {{ position_name_en }}</p>
<p>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.</p>

<!-- Motivation Box -->
Expand All @@ -103,11 +103,11 @@
</p>
<p><strong>Important:</strong> You must use the same email address ({{ user.email }}) on your account for the nomination to be linked to your candidacy.</p>
<p>Deadline for candidacy submission: <strong>{{ deadline_date }}</strong></p>
<p>If you have questions about the election or nomination process, contact the Nomination Committée at
<p>If you have questions about the election or nomination process, contact the Nomination Committee at
<a href="mailto:{{ election_admin_email }}">{{ election_admin_email }}</a>.
</p>
<p>Good luck!<br>
Nomination Committée, F-Guild at TLTH</p>
Nomination Committee, F-Guild at TLTH</p>
<hr style="border:none; border-top:1px solid #ddd; margin: 40px 0 20px;">
<p style="font-size: 12px; color: #888;">
You are receiving this email because someone has nominated you for a position within the F-Guild.
Expand Down
Loading