mirror of
https://github.com/simple-login/app.git
synced 2024-11-18 06:31:27 +08:00
remove "trigger-email"
This commit is contained in:
parent
af431c3d8b
commit
bbcd4fc355
2 changed files with 5 additions and 29 deletions
|
@ -225,7 +225,8 @@
|
||||||
<select id="mailbox-{{ alias.id }}"
|
<select id="mailbox-{{ alias.id }}"
|
||||||
class="form-control form-control-sm custom-select" name="mailbox">
|
class="form-control form-control-sm custom-select" name="mailbox">
|
||||||
{% for mailbox in mailboxes %}
|
{% for mailbox in mailboxes %}
|
||||||
<option value="{{ mailbox.id }}" {% if mailbox.id == alias_info.mailbox.id %} selected {% endif %}>
|
<option value="{{ mailbox.id }}" {% if mailbox.id == alias_info.mailbox.id %}
|
||||||
|
selected {% endif %}>
|
||||||
{{ mailbox.email }}
|
{{ mailbox.email }}
|
||||||
</option>
|
</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -409,19 +410,6 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".trigger-email").on("click", function (e) {
|
|
||||||
notie.confirm({
|
|
||||||
text: "SimpleLogin server will send an email to this alias " +
|
|
||||||
"and it will arrive to your inbox, please confirm.",
|
|
||||||
cancelCallback: () => {
|
|
||||||
// nothing to do
|
|
||||||
},
|
|
||||||
submitCallback: () => {
|
|
||||||
$(this).closest("form").submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".custom-switch-input").change(async function (e) {
|
$(".custom-switch-input").change(async function (e) {
|
||||||
let aliasId = $(this).data("alias");
|
let aliasId = $(this).data("alias");
|
||||||
let alias = $(this).parent().find(".alias").val();
|
let alias = $(this).parent().find(".alias").val();
|
||||||
|
|
|
@ -33,19 +33,7 @@ def index():
|
||||||
|
|
||||||
# User generates a new email
|
# User generates a new email
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if request.form.get("form-name") == "trigger-email":
|
if request.form.get("form-name") == "create-custom-email":
|
||||||
alias_id = request.form.get("alias-id")
|
|
||||||
alias = Alias.get(alias_id)
|
|
||||||
|
|
||||||
LOG.d("trigger an email to %s", alias)
|
|
||||||
email_utils.send_test_email_alias(alias.email, alias.user.name)
|
|
||||||
|
|
||||||
flash(
|
|
||||||
f"An email sent to {alias.email} is on its way, please check your inbox/spam folder",
|
|
||||||
"success",
|
|
||||||
)
|
|
||||||
|
|
||||||
elif request.form.get("form-name") == "create-custom-email":
|
|
||||||
if current_user.can_create_new_alias():
|
if current_user.can_create_new_alias():
|
||||||
return redirect(url_for("dashboard.custom_alias"))
|
return redirect(url_for("dashboard.custom_alias"))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue