-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Added Email Batch Summary #132
Implements and closes #132. --------- Co-authored-by: Federico Capoano <[email protected]> Co-authored-by: Gagan Deep <[email protected]>
- Loading branch information
1 parent
95c1618
commit 069de84
Showing
10 changed files
with
408 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
openwisp_notifications/templates/emails/batch_email.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{% block styles %} | ||
<style type="text/css"> | ||
.alert { | ||
border: 1px solid #e0e0e0; | ||
border-radius: 5px; | ||
margin-bottom: 10px; | ||
padding: 10px; | ||
} | ||
.alert.error { | ||
background-color: #ffefef; | ||
} | ||
.alert.info { | ||
background-color: #f0f0f0; | ||
} | ||
.alert.success { | ||
background-color: #e6f9e8; | ||
} | ||
.alert h2 { | ||
margin: 0 0 5px 0; | ||
font-size: 16px; | ||
} | ||
.alert h2 .title { | ||
display: inline-block; | ||
max-width: 80%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
vertical-align: middle; | ||
} | ||
.alert.error h2 { | ||
color: #d9534f; | ||
} | ||
.alert.info h2 { | ||
color: #333333; | ||
} | ||
.alert.success h2 { | ||
color: #1c8828; | ||
} | ||
.alert p { | ||
margin: 0; | ||
font-size: 14px; | ||
color: #666; | ||
} | ||
.alert .title p { | ||
display: inline; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
.badge { | ||
display: inline-block; | ||
padding: 2px 8px; | ||
border-radius: 3px; | ||
font-size: 12px; | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
margin-right: 5px; | ||
color: white; | ||
} | ||
.badge.error { | ||
background-color: #d9534f; | ||
} | ||
.badge.info { | ||
background-color: #333333; | ||
} | ||
.badge.success { | ||
background-color: #1c8828; | ||
} | ||
.alert a { | ||
text-decoration: none; | ||
} | ||
.alert.error a { | ||
color: #d9534f; | ||
} | ||
.alert.info a { | ||
color: #333333; | ||
} | ||
.alert.success a { | ||
color: #1c8828; | ||
} | ||
.alert a:hover { | ||
text-decoration: underline; | ||
} | ||
</style> | ||
{% endblock styles %} | ||
|
||
{% block mail_body %} | ||
<div> | ||
{% for notification in notifications %} | ||
<div class="alert {{ notification.level }}"> | ||
<h2> | ||
<span class="badge {{ notification.level }}">{{ notification.level|upper }}</span> | ||
<span class="title"> | ||
{% if notification.url %} | ||
<a href="{{ notification.url }}" target="_blank">{{ notification.email_message }}</a> | ||
{% else %} | ||
{{ notification.email_message }} | ||
{% endif %} | ||
</span> | ||
</h2> | ||
<p>{{ notification.timestamp|date:"F j, Y, g:i a" }}</p> | ||
{% if notification.rendered_description %} | ||
<p>{{ notification.rendered_description|safe }}</p> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endblock mail_body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% load i18n %} | ||
|
||
[{{ site_name }}] {{ notifications_count }} {% translate "new notifications since" %} {{ start_time }} | ||
|
||
{% for notification in notifications %} | ||
- {{ notification.email_message }}{% if notification.rendered_description %} | ||
{% translate "Description" %}: {{ notification.rendered_description }}{% endif %} | ||
{% translate "Date & Time" %}: {{ notification.timestamp|date:"F j, Y, g:i a" }}{% if notification.url %} | ||
{% translate "URL" %}: {{ notification.url }}{% endif %} | ||
{% endfor %} | ||
|
||
{% if call_to_action_url %} | ||
{{ call_to_action_text }}: {{ call_to_action_url }} | ||
{% endif %} |
Oops, something went wrong.