mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
Merge pull request #834 from simple-login/feature/improve-notif
Improve notification
This commit is contained in:
commit
9807d32159
@ -23,6 +23,10 @@ def notification_route(notification_id):
|
|||||||
)
|
)
|
||||||
return redirect(url_for("dashboard.index"))
|
return redirect(url_for("dashboard.index"))
|
||||||
|
|
||||||
|
if not notification.read:
|
||||||
|
notification.read = True
|
||||||
|
Session.commit()
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
notification_title = notification.title or notification.message[:20]
|
notification_title = notification.title or notification.message[:20]
|
||||||
Notification.delete(notification_id)
|
Notification.delete(notification_id)
|
||||||
|
@ -1401,6 +1401,15 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog):
|
|||||||
f"Disable alias {alias} because {reason}. {alias.mailboxes} {alias.user}. Last contact {contact}"
|
f"Disable alias {alias} because {reason}. {alias.mailboxes} {alias.user}. Last contact {contact}"
|
||||||
)
|
)
|
||||||
alias.enabled = False
|
alias.enabled = False
|
||||||
|
|
||||||
|
Notification.create(
|
||||||
|
user_id=user.id,
|
||||||
|
title=f"{alias.email} has been disabled due to multiple bounces",
|
||||||
|
message=Notification.render(
|
||||||
|
"notification/alias-disable.html", alias=alias, mailbox=mailbox
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
||||||
send_email_with_rate_control(
|
send_email_with_rate_control(
|
||||||
|
@ -38,15 +38,13 @@
|
|||||||
|
|
||||||
<div class="dropdown-item d-flex" v-for="notification in notifications">
|
<div class="dropdown-item d-flex" v-for="notification in notifications">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<div v-html="notification.title" class="font-weight-bold"
|
|
||||||
|
<div v-html="notification.title || notification.message"
|
||||||
|
:class="!notification.read && 'font-weight-bold'"
|
||||||
style="width: 40em; word-wrap:break-word; white-space: normal; overflow: hidden;"></div>
|
style="width: 40em; word-wrap:break-word; white-space: normal; overflow: hidden;"></div>
|
||||||
|
|
||||||
|
|
||||||
<div v-html="notification.message"
|
<div v-if="notification.title">
|
||||||
style="width: 40em; word-wrap:break-word; white-space: normal; overflow: hidden; max-height: 100px; text-overflow: ellipsis;">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<a :href="'/dashboard/notification/' + notification.id">More</a>
|
<a :href="'/dashboard/notification/' + notification.id">More</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
10
templates/notification/alias-disable.html
Normal file
10
templates/notification/alias-disable.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<div>
|
||||||
|
There are several emails sent to your alias <b>{{ alias.email }}</b> that have been bounced by your
|
||||||
|
mailbox <b>{{ mailbox.email }}</b>.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
As security measure, we have disabled the alias <b>{{ alias.email }}</b>.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user