angestoepselt: Display email after form submission

See: #202
This commit is contained in:
Yannik Rödel 2025-10-29 03:13:25 +01:00
parent d9eb2b3dd2
commit a13a4cbd84
2 changed files with 14 additions and 2 deletions

View file

@ -403,7 +403,7 @@ try:
print("Status: 302 Found") print("Status: 302 Found")
print("Content-Type: text/html") print("Content-Type: text/html")
print(f"Location: /kontakt/fertig") print(f"Location: /kontakt/fertig#{urllib.parse.urlencode(dict(email=contact_email))}")
print("") print("")
except Exception as e: except Exception as e:
fail("500 Internal Server Error", str(e)) fail("500 Internal Server Error", str(e))

View file

@ -33,4 +33,16 @@ extraStylesheets: ['finish']
**Vielen Dank** —  **Vielen Dank** — 
Wir haben deine Anfrage erhalten und melden uns bei dir. Wir haben deine Anfrage erhalten und melden uns bei dir.
Du erhältst in Kürze eine Bestätigung per E-Mail. Du erhältst in Kürze eine Bestätigung per E-Mail.
Wenn du _keine E-Mail_ bekommst, prüfe bitte deinen Spam-Ordner. Kontrolliere auch, ob du die richtige E-Mail-Adresse angegeben hast.
Falls du _keine E-Mail_ bekommst, prüfe bitte deinen Spam-Ordner.
<span id="email-hint"></span>
<script>
(() => {
const payload = new URLSearchParams(location.hash.replace(/^#/, ""));
const email = payload.get("email");
if (email)
document.getElementById("email-hint").innerText = `Kontrolliere auch, ob du die richtige E-Mail-Addrresse angegeben hast: ${email}.`;
if (payload.has())
})();
</script>