changes to the register option to have an optin button for the marketing emails
This commit is contained in:
+3
-1
@@ -1904,6 +1904,7 @@ def register():
|
||||
email = (request.form.get("email") or "").strip().lower()
|
||||
password = request.form.get("password") or ""
|
||||
password_repeat = request.form.get("password_repeat") or ""
|
||||
marketing_opt_in = True if request.form.get("marketing_opt_in") == "on" else False
|
||||
|
||||
if not username or not school_name or not contact_person or not email or not password or not password_repeat:
|
||||
flash("Bitte alle Felder ausfüllen.", "error")
|
||||
@@ -1936,7 +1937,8 @@ def register():
|
||||
try:
|
||||
existing_users = user_store.get_all_users() or []
|
||||
is_first_user = len(existing_users) == 0
|
||||
if not user_store.add_user(username, password, school_name, contact_person, email):
|
||||
|
||||
if not user_store.add_user(username, password, school_name, contact_person, email, marketing_opt_in=marketing_opt_in):
|
||||
flash("Benutzer konnte nicht erstellt werden.", "error")
|
||||
return redirect(url_for("register"))
|
||||
|
||||
|
||||
@@ -55,13 +55,18 @@
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.6rem;
|
||||
margin: 0.35rem 0 1rem;
|
||||
margin: 1.1rem 0 1.3rem;
|
||||
color: #244f66;
|
||||
font-size: 0.95rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.checkbox-line input {
|
||||
width: auto;
|
||||
margin-top: 0.2rem;
|
||||
.checkbox-line input[type="checkbox"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin-top: 0.1rem;
|
||||
accent-color: #0a5f8f;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.auth-btn {
|
||||
@@ -117,8 +122,13 @@
|
||||
<label for="password_repeat">Passwort wiederholen</label>
|
||||
<input id="password_repeat" name="password_repeat" type="password" autocomplete="new-password" required>
|
||||
</div>
|
||||
<label class="checkbox-line">
|
||||
<input id="marketing_opt_in" name="marketing_opt_in" type="checkbox">
|
||||
<span>Ja, ich möchte E-Mails zu Produktupdates, Neuigkeiten und Marketinginformationen erhalten. (Abmeldung jederzeit möglich)</span>
|
||||
</label>
|
||||
|
||||
<button class="auth-btn" type="submit">Konto erstellen</button>
|
||||
</form>
|
||||
<p class="auth-meta">Bereits registriert? <a href="{{ url_for('login') }}">Zum Login</a></p>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user