From 87d760fc9ee57354d061ed2f5932a5426ea09c2c Mon Sep 17 00:00:00 2001 From: jschiel Date: Thu, 26 Oct 2023 19:43:56 +0200 Subject: [PATCH] added welcome mail --- backend/mail.py | 6 ++++++ backend/main.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/backend/mail.py b/backend/mail.py index 957e6e5..5b79d77 100644 --- a/backend/mail.py +++ b/backend/mail.py @@ -42,6 +42,12 @@ def send_transfer_mails(from_name, from_alias, to_name, to_alias, from_message, Dein Getränkelisten Team """) + +def send_welcome_mail(username): + mail=mail_from_username(username) + send_mail("Wilkommen zur Drinklist",mail,f"""Hallo, +du wurdest zur Drinklist hinzugefügt. Du kannst ab jetzt auf {util.domain} Getränke abstreichen. +""") def compile_latex(name): diff --git a/backend/main.py b/backend/main.py index 5a4deb4..576c4d0 100644 --- a/backend/main.py +++ b/backend/main.py @@ -311,6 +311,9 @@ def post(self): else: db.add_user(request.json["name"], request.json["money"], request.json["password"]) + + mail.send_welcome_mail(request.json["name"]) + return util.build_response("User added")