Skip to content

Commit d04820a

Browse files
Dhanus3133nemesifier
authored andcommitted
[docs] Added docs for Email Batches #306
Closes: #306 Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
1 parent c2489b1 commit d04820a

File tree

4 files changed

+80
-13
lines changed

4 files changed

+80
-13
lines changed

docs/user/intro.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include:
77

88
- :doc:`sending-notifications`
99
- :ref:`notifications_web_notifications`
10-
- :ref:`notifications_email_notifications`
10+
- :ref:`notifications_email_notifications` and
11+
:ref:`notifications_batches`
1112
- :doc:`notification-types`
1213
- :doc:`User notification preferences <notification-preferences>`
1314
- :ref:`Silencing notifications for specific objects temporarily or

docs/user/settings.rst

+31
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,34 @@ The default configuration is as follows:
156156
# Maximum interval after which the notification widget should get updated (in seconds)
157157
"max_allowed_backoff": 15,
158158
}
159+
160+
.. _openwisp_notifications_email_batch_interval:
161+
162+
``OPENWISP_NOTIFICATIONS_EMAIL_BATCH_INTERVAL``
163+
-----------------------------------------------
164+
165+
======= =================================
166+
Type ``int``
167+
Default ``1800`` (30 minutes, in seconds)
168+
======= =================================
169+
170+
This setting determines the :ref:`interval of the email batching feature
171+
<notifications_batches>`.
172+
173+
The interval is specified in seconds.
174+
175+
To send email notifications immediately without batching, set this value
176+
to ``0``.
177+
178+
.. _openwisp_notifications_email_batch_display_limit:
179+
180+
``OPENWISP_NOTIFICATIONS_EMAIL_BATCH_DISPLAY_LIMIT``
181+
----------------------------------------------------
182+
183+
======= =======
184+
Type ``int``
185+
Default ``15``
186+
======= =======
187+
188+
This setting specifies the maximum number of email notifications that can
189+
be included in a single :ref:`email batch <notifications_batches>`.

docs/user/web-email-notifications.rst

+35
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,38 @@ Email Notifications
5454
Along with web notifications OpenWISP Notifications also sends email
5555
notifications leveraging the :ref:`send_email feature of OpenWISP Utils
5656
<utils_send_email>`.
57+
58+
.. _notifications_batches:
59+
60+
Email Batches
61+
~~~~~~~~~~~~~
62+
63+
.. figure:: https://i.imgur.com/W5P009W.png
64+
:target: https://i.imgur.com/W5P009W.png
65+
:align: center
66+
67+
Batching email notifications helps manage the flow of emails sent to
68+
users, especially during periods of increased alert activity. By grouping
69+
emails into batches, the system minimizes the risk of emails being marked
70+
as spam and prevents inboxes from rejecting alerts due to high volumes.
71+
72+
Key aspects of the batch email notification feature include:
73+
74+
- When multiple emails are triggered for the same user within a short time
75+
frame, subsequent emails are grouped into a summary.
76+
- The sending of individual emails is paused for a specified batch
77+
interval when batching is enabled.
78+
79+
.. note::
80+
81+
If new alerts are received while a batch is pending, they will be
82+
added to the current summary without resetting the timer. The batched
83+
email will be sent when the initial batch interval expires.
84+
85+
You can customize the behavior of batch email notifications using the
86+
following settings:
87+
88+
- :ref:`OPENWISP_NOTIFICATIONS_EMAIL_BATCH_INTERVAL
89+
<openwisp_notifications_email_batch_interval>`.
90+
- :ref:`OPENWISP_NOTIFICATIONS_EMAIL_BATCH_DISPLAY_LIMIT
91+
<openwisp_notifications_email_batch_display_limit>`.

openwisp_notifications/templates/emails/batch_email.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
.alert.success {
1616
background-color: #e6f9e8;
1717
}
18+
.alert.warning {
19+
background-color: #fff8e1;
20+
}
1821
.alert h2 {
1922
margin: 0 0 5px 0;
2023
font-size: 16px;
@@ -27,15 +30,6 @@
2730
text-overflow: ellipsis;
2831
vertical-align: middle;
2932
}
30-
.alert.error h2 {
31-
color: #d9534f;
32-
}
33-
.alert.info h2 {
34-
color: #333333;
35-
}
36-
.alert.success h2 {
37-
color: #1c8828;
38-
}
3933
.alert p {
4034
margin: 0;
4135
font-size: 14px;
@@ -65,18 +59,24 @@
6559
.badge.success {
6660
background-color: #1c8828;
6761
}
62+
.badge.warning {
63+
background-color: #f0ad4e;
64+
}
6865
.alert a {
6966
text-decoration: none;
7067
}
71-
.alert.error a {
68+
.alert.error a, .alert.error h2 {
7269
color: #d9534f;
7370
}
74-
.alert.info a {
71+
.alert.info a, .alert.info h2 {
7572
color: #333333;
7673
}
77-
.alert.success a {
74+
.alert.success a, .alert.success h2 {
7875
color: #1c8828;
7976
}
77+
.alert.warning a, .alert.warning h2 {
78+
color: #f0ad4e;
79+
}
8080
.alert a:hover {
8181
text-decoration: underline;
8282
}

0 commit comments

Comments
 (0)