mirror of
https://github.com/simple-login/app.git
synced 2024-11-17 22:21:38 +08:00
Add include_sender_in_reverse_alias on Setting page
This commit is contained in:
parent
ce2d68a64d
commit
fec281b84f
2 changed files with 35 additions and 0 deletions
|
@ -305,6 +305,31 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- END Reverse-alias -->
|
<!-- END Reverse-alias -->
|
||||||
|
|
||||||
|
<!-- Sender included in reverse-alias -->
|
||||||
|
<div class="card" id="sender-in-ra">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="card-title">Include sender address in reverse-alias</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
By default, the reverse-alias is randomly generated and doesn't contain any information about
|
||||||
|
the sender.<br>
|
||||||
|
|
||||||
|
You can however enable this option to include the sender address in the reverse-alias. <br>
|
||||||
|
|
||||||
|
This can be useful when setting up an email filter and makes the reverse-alias more readable.
|
||||||
|
</div>
|
||||||
|
<form method="post" action="#sender-in-ra">
|
||||||
|
<input type="hidden" name="form-name" value="sender-in-ra">
|
||||||
|
<div class="form-check">
|
||||||
|
<input type="checkbox" id="include-sender-ra" name="enable"
|
||||||
|
{% if current_user.include_sender_in_reverse_alias %} checked {% endif %} class="form-check-input">
|
||||||
|
<label for="include-sender-ra">Include sender address in reverse-alias</label>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-outline-primary">Update</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END Reverse-alias -->
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-title">Quarantine</div>
|
<div class="card-title">Quarantine</div>
|
||||||
|
|
|
@ -255,6 +255,16 @@ def setting():
|
||||||
flash("Your preference has been updated", "success")
|
flash("Your preference has been updated", "success")
|
||||||
return redirect(url_for("dashboard.setting"))
|
return redirect(url_for("dashboard.setting"))
|
||||||
|
|
||||||
|
elif request.form.get("form-name") == "sender-in-ra":
|
||||||
|
choose = request.form.get("enable")
|
||||||
|
if choose == "on":
|
||||||
|
current_user.include_sender_in_reverse_alias = True
|
||||||
|
else:
|
||||||
|
current_user.include_sender_in_reverse_alias = False
|
||||||
|
db.session.commit()
|
||||||
|
flash("Your preference has been updated", "success")
|
||||||
|
return redirect(url_for("dashboard.setting"))
|
||||||
|
|
||||||
elif request.form.get("form-name") == "export-data":
|
elif request.form.get("form-name") == "export-data":
|
||||||
data = {
|
data = {
|
||||||
"email": current_user.email,
|
"email": current_user.email,
|
||||||
|
|
Loading…
Reference in a new issue