Notify user cycle email (#1035)
* notify user about a cycle email * prettify notification detail page
This commit is contained in:
parent
e688f04d6b
commit
84fcc9ddc4
|
@ -550,6 +550,18 @@ def handle_email_sent_to_ourself(alias, from_addr: str, msg: Message, user):
|
||||||
# link available for 6 days as it gets deleted in 7 days
|
# link available for 6 days as it gets deleted in 7 days
|
||||||
refused_email_url = refused_email.get_url(expires_in=518400)
|
refused_email_url = refused_email.get_url(expires_in=518400)
|
||||||
|
|
||||||
|
Notification.create(
|
||||||
|
user_id=user.id,
|
||||||
|
title=f"Email sent to {alias.email} from its own mailbox {from_addr}",
|
||||||
|
message=Notification.render(
|
||||||
|
"notification/cycle-email.html",
|
||||||
|
alias=alias,
|
||||||
|
from_addr=from_addr,
|
||||||
|
refused_email_url=refused_email_url,
|
||||||
|
),
|
||||||
|
commit=True,
|
||||||
|
)
|
||||||
|
|
||||||
send_email_at_most_times(
|
send_email_at_most_times(
|
||||||
user,
|
user,
|
||||||
ALERT_SEND_EMAIL_CYCLE,
|
ALERT_SEND_EMAIL_CYCLE,
|
||||||
|
|
|
@ -18,9 +18,8 @@
|
||||||
{{ notification.message | safe }}
|
{{ notification.message | safe }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<form method="post" class="float-right mt-3"
|
||||||
|
onsubmit="return confirm('This operation is not reversible, please confirm');">
|
||||||
<form method="post" class="mt-3" onsubmit="return confirm('This operation is not reversible, please confirm');">
|
|
||||||
<button class="btn btn-outline-danger">Delete</button>
|
<button class="btn btn-outline-danger">Delete</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<div>
|
||||||
|
An email was sent to your alias <b>{{ alias.email }}</b> from its own mailbox <b>{{ from_addr }}</b>.
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
SimpleLogin doesn't send this email back to your mailbox as it would be refused or hidden anyway by your email
|
||||||
|
service.
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
So no worries, there's nothing you need to do :).
|
||||||
|
</div>
|
Loading…
Reference in New Issue