change sto the path
This commit is contained in:
@@ -344,9 +344,9 @@ def send_accreditation_email(
|
|||||||
address: str = "[Straße, Hausnummer] [PLZ, Ort]",
|
address: str = "[Straße, Hausnummer] [PLZ, Ort]",
|
||||||
price: str = "250,00",
|
price: str = "250,00",
|
||||||
date: str = "[Ort, Datum]",
|
date: str = "[Ort, Datum]",
|
||||||
software_name: str = "Invario Inventarsystem"
|
software_name: str = "Invario Inventarsystem",
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Generiert den Hauptvertrag temporär und versendet ihn zusammen mit AGB & AVV per E-Mail."""
|
"""Generiert den Hauptvertrag temporär und versendet ihn zusammen mit Rechnung, AGB & AVV per E-Mail."""
|
||||||
|
|
||||||
# Clean Sanitization für Dateinamen
|
# Clean Sanitization für Dateinamen
|
||||||
safe_school_name = "".join([c for c in school_name if c.isalnum() or c in (' ', '_', '-')]).rstrip()
|
safe_school_name = "".join([c for c in school_name if c.isalnum() or c in (' ', '_', '-')]).rstrip()
|
||||||
@@ -364,16 +364,16 @@ def send_accreditation_email(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 2. Pfade zu den statischen Dokumenten
|
# 2. Pfade zu den statischen Dokumenten
|
||||||
agb_pdf_path = os.path.join("static", "download", "AGB Invario.pdf")
|
agb_pdf_path = os.path.join("opt", "Key-service-Server", "Website", "static", "download", "AGB Invario.pdf")
|
||||||
avv_pdf_path = os.path.join("static", "download", "AVV Invario.pdf")
|
avv_pdf_path = os.path.join("opt", "Key-service-Server", "Website", "static", "download", "AVV Invario.pdf")
|
||||||
|
|
||||||
# 3. E-Mail Inhalte
|
# 3. E-Mail Inhalte anpassen
|
||||||
subject = "Ihre Zugangsdaten und Unterlagen für Invario"
|
subject = "Ihre Zugangsdaten und Unterlagen für Invario"
|
||||||
|
|
||||||
text_note = (
|
text_note = (
|
||||||
f"Sehr geehrte/r {username},\n\n"
|
f"Sehr geehrte/r {username},\n\n"
|
||||||
"Vielen Dank für Ihre Akkreditierung bei Invario. "
|
"Vielen Dank für Ihre Akkreditierung bei Invario. "
|
||||||
"Im Anhang finden Sie Ihren Hauptvertrag sowie die AGB und den AVV.\n\n"
|
"Im Anhang finden Sie Ihre Rechnung, den Hauptvertrag sowie die AGB und den AVV.\n\n"
|
||||||
f"Ihre Zugangsdaten:\n"
|
f"Ihre Zugangsdaten:\n"
|
||||||
f"Domain: https://{domain}\n"
|
f"Domain: https://{domain}\n"
|
||||||
f"Benutzername: {username}\n"
|
f"Benutzername: {username}\n"
|
||||||
@@ -385,7 +385,7 @@ def send_accreditation_email(
|
|||||||
<div style="font-family: Arial, Helvetica, sans-serif; color: #333333;">
|
<div style="font-family: Arial, Helvetica, sans-serif; color: #333333;">
|
||||||
<h2 style="color: #2c3e50; margin-top: 0;">Willkommen bei Invario!</h2>
|
<h2 style="color: #2c3e50; margin-top: 0;">Willkommen bei Invario!</h2>
|
||||||
<p style="font-size: 15px; line-height: 1.6;">
|
<p style="font-size: 15px; line-height: 1.6;">
|
||||||
Vielen Dank für Ihre Akkreditierung. Im Anhang finden Sie Ihren Hauptvertrag sowie die AGB und den AVV.
|
Vielen Dank für Ihre Akkreditierung. Im Anhang finden Sie Ihre Rechnung, den Hauptvertrag sowie die AGB und den AVV.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 style="color: #2c3e50;">Ihre Zugangsdaten:</h3>
|
<h3 style="color: #2c3e50;">Ihre Zugangsdaten:</h3>
|
||||||
@@ -404,9 +404,11 @@ def send_accreditation_email(
|
|||||||
# 4. Vorhandene Anhänge einsammeln
|
# 4. Vorhandene Anhänge einsammeln
|
||||||
attachments = []
|
attachments = []
|
||||||
|
|
||||||
|
# Hauptvertrag anfügen
|
||||||
if os.path.exists(contract_pdf_path):
|
if os.path.exists(contract_pdf_path):
|
||||||
attachments.append(contract_pdf_path)
|
attachments.append(contract_pdf_path)
|
||||||
|
|
||||||
|
# AGB & AVV anfügen
|
||||||
if os.path.exists(agb_pdf_path):
|
if os.path.exists(agb_pdf_path):
|
||||||
attachments.append(agb_pdf_path)
|
attachments.append(agb_pdf_path)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user