Skip to content

Commit

Permalink
[fix] Fomatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhanus3133 committed Aug 25, 2024
1 parent 4e8a392 commit ad7d211
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
51 changes: 35 additions & 16 deletions docs/user/batch-email-notifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,38 @@ Batch Email Notifications
Batch Email Notifications
-------------------------

Batch email notifications help manage the volume of emails sent to users, particularly during periods of high alert activity. By batching emails, the system reduces the risk of emails being flagged as spam and prevents email inboxes from rejecting alerts due to overuse. The following features and configurations make up the batch email notification system:
Batch email notifications help manage the volume of emails sent to users,
particularly during periods of high alert activity. By batching emails,
the system reduces the risk of emails being flagged as spam and prevents
email inboxes from rejecting alerts due to overuse. The following features
and configurations make up the batch email notification system:

Batch Email Feature
~~~~~~~~~~~~~~~~~~~

The batch email notification feature ensures that:

- If more than one email is sent to a specific user within a 30-minute window, subsequent emails are batched into a summary.
- The sending of individual emails is paused for 30 minutes when batching is active.
- **Note**: If new alerts arrive while a batch is pending, they are added to the existing summary. However, the timer does not reset. The batch email will be sent out when the initial 30-minute interval expires.
- If more than one email is sent to a specific user within a 30-minute
window, subsequent emails are batched into a summary.
- The sending of individual emails is paused for 30 minutes when batching
is active.
- **Note**: If new alerts arrive while a batch is pending, they are added
to the existing summary. However, the timer does not reset. The batch
email will be sent out when the initial 30-minute interval expires.

Batch Email Example
~~~~~~~~~~~~~~~~~~~

Here is an example scenario where batch email notifications can be helpful:
Here is an example scenario where batch email notifications can be
helpful:

1. Multiple infrastructure issues cause numerous alerts within a short period.
2. Without batching, each alert triggers an individual email, overwhelming the recipient's inbox.
3. With batch email notifications enabled, the alerts are summarized into a single email, sent after the issues subside or the batch timer expires.
1. Multiple infrastructure issues cause numerous alerts within a short
period.
2. Without batching, each alert triggers an individual email, overwhelming
the recipient's inbox.
3. With batch email notifications enabled, the alerts are summarized into
a single email, sent after the issues subside or the batch timer
expires.

Batch Email Summary
~~~~~~~~~~~~~~~~~~~
Expand All @@ -40,25 +53,31 @@ Batch Email Summary
The batch email system provides a summary that includes:

- A list of the most recent notifications, limited by the display limit.
- A call-to-action to view all notifications if the number exceeds the display limit.
- The time the batch started, helping users understand the context of the alerts.
- A call-to-action to view all notifications if the number exceeds the
display limit.
- The time the batch started, helping users understand the context of the
alerts.

Configuration Options
~~~~~~~~~~~~~~~~~~~~~

The following default configurations can be adjusted according to the needs:
The following default configurations can be adjusted according to the
needs:

- **Email Batch Interval**: The time period for which individual email sending is paused when a batch is active. The default is set to 30 minutes.
- **Email Batch Display Limit**: The maximum number of notifications displayed in a single batch email. The default is 15.
- **Email Batch Interval**: The time period for which individual email
sending is paused when a batch is active. The default is set to 30
minutes.
- **Email Batch Display Limit**: The maximum number of notifications
displayed in a single batch email. The default is 15.

These configurations are set in the `settings.py` file:

.. code-block:: python
::

EMAIL_BATCH_INTERVAL = getattr(
settings, 'OPENWISP_NOTIFICATIONS_EMAIL_BATCH_INTERVAL', 30 * 60 # 30 minutes
settings, "OPENWISP_NOTIFICATIONS_EMAIL_BATCH_INTERVAL", 30 * 60 # 30 minutes
)

EMAIL_BATCH_DISPLAY_LIMIT = getattr(
settings, 'OPENWISP_NOTIFICATIONS_EMAIL_BATCH_DISPLAY_LIMIT', 15
settings, "OPENWISP_NOTIFICATIONS_EMAIL_BATCH_DISPLAY_LIMIT", 15
)
6 changes: 4 additions & 2 deletions docs/user/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ type ``int``
default ``1800`` `(30 mins, in seconds)`
======= ================================

This setting defines the interval at which the email notifications are sent in batches to users within the specified interval.
This setting defines the interval at which the email notifications are
sent in batches to users within the specified interval.

If you want to send email notifications immediately, then set it to ``0``.

Expand All @@ -177,4 +178,5 @@ type ``int``
default ``15``
======= =======

This setting defines the number of email notifications to be displayed in a batched email.
This setting defines the number of email notifications to be displayed in
a batched email.

0 comments on commit ad7d211

Please sign in to comment.