From 33fd40f6ce63e9cb4ae26dce8e219e5b8c7c9cf2 Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 28 Mar 2020 22:36:19 +0100 Subject: [PATCH] User can choose which sender format they prefer --- .../templates/dashboard/setting.html | 37 ++++++++++++++++++- app/dashboard/views/setting.py | 9 +++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/app/dashboard/templates/dashboard/setting.html b/app/dashboard/templates/dashboard/setting.html index bee5619e..dabfe490 100644 --- a/app/dashboard/templates/dashboard/setting.html +++ b/app/dashboard/templates/dashboard/setting.html @@ -166,6 +166,41 @@ +
+
+
Sender address format
+
+ When your alias receives an email, says from John Wick <john@wick.com>, + SimpleLogin forwards it to your mailbox.
+ + Due to some email constraints, SimpleLogin cannot keep the sender email address + in the original form and needs to transform it to one of the 2 below formats. +
+ +
+ + +
+ + +
+ +
+ + +
+ + +
+
+
+
@@ -183,7 +218,7 @@
-
+
Quarantine
diff --git a/app/dashboard/views/setting.py b/app/dashboard/views/setting.py index 9b95d807..4379300b 100644 --- a/app/dashboard/views/setting.py +++ b/app/dashboard/views/setting.py @@ -155,6 +155,15 @@ def setting(): db.session.commit() flash("Your preference has been updated", "success") return redirect(url_for("dashboard.setting")) + elif request.form.get("form-name") == "change-sender-format": + sender_format = int(request.form.get("sender-format")) + if sender_format == 0: + current_user.use_via_format_for_sender = False + else: + current_user.use_via_format_for_sender = True + db.session.commit() + flash("Your sender format preference has been updated", "success") + return redirect(url_for("dashboard.setting")) elif request.form.get("form-name") == "export-data": data = {