|
1 | | - |
2 | 1 | # Notification Configuration Guide |
3 | 2 |
|
4 | 3 | This guide explains how to override default notification settings for the platform without modifying the core code base. You can customize delivery channels (Web, Email) and behavior for specific notification types or entire notification apps using your Django settings. |
@@ -31,24 +30,27 @@ You can only modify the following fields for a notification type. Any other fiel |
31 | 30 | | `email` | `bool` | Enable/Disable email delivery. | |
32 | 31 | | `push` | `bool` | Enable/Disable push notifications. | |
33 | 32 | | `non_editable` | `list` | Prevent users from changing preferences for these channels. | |
| 33 | +| `email_cadence` | `str` or `EmailCadence` | How often emails are sent. Allowed values: `Daily`, `Weekly`, `Immediately`, `Never` (or use the `EmailCadence` enum constants). |
34 | 34 |
|
35 | 35 | ### Example Configuration |
36 | 36 |
|
37 | 37 | In your `settings.py` (or equivalent): |
38 | 38 |
|
39 | 39 | ```python |
40 | 40 | NOTIFICATION_TYPES_OVERRIDE = { |
41 | | - # CASE 1: Disable emails for new discussion posts by default |
| 41 | + # Disable emails for new discussion posts by default and set daily cadence |
42 | 42 | 'new_discussion_post': { |
43 | 43 | 'email': False, |
44 | | - 'web': True |
| 44 | + 'web': True, |
| 45 | + 'email_cadence': 'Daily', |
45 | 46 | }, |
46 | 47 |
|
47 | | - # CASE 2: Force "Course Updates" to be strictly email-only (users cannot disable it) |
| 48 | + # Force "Course Updates" to be strictly email-only and deliver immediately |
48 | 49 | 'course_updates': { |
49 | 50 | 'email': True, |
50 | 51 | 'web': False, |
51 | | - 'non_editable': ['email'] # User UI will lock the email toggle |
| 52 | + 'non_editable': ['email'], |
| 53 | + 'email_cadence': 'Immediately', |
52 | 54 | } |
53 | 55 | } |
54 | 56 |
|
@@ -79,23 +81,25 @@ These keys affect all "Core" notifications belonging to the app. |
79 | 81 | | `core_email` | `bool` | Enable/Disable email delivery for core events. | |
80 | 82 | | `core_push` | `bool` | Enable/Disable push delivery for core events. | |
81 | 83 | | `non_editable` | `list` | Channels users cannot modify (e.g., `['email']`). | |
| 84 | +| `core_email_cadence` | `str` or `EmailCadence` | Default email cadence for core notifications. Allowed values: `Daily`, `Weekly`, `Immediately`, `Never` (or use the `EmailCadence` enum constants). |
82 | 85 |
|
83 | 86 | ### Example Configuration |
84 | 87 |
|
85 | 88 | ```python |
86 | 89 | NOTIFICATION_APPS_OVERRIDE = { |
87 | | - # CASE: Make all Discussion notifications (comments, responses, etc.) |
88 | | - # Web-only by default to reduce email spam. |
| 90 | + # Make all Discussion core notifications Web-only and weekly cadence |
89 | 91 | 'discussion': { |
90 | 92 | 'core_email': False, |
91 | 93 | 'core_web': True, |
| 94 | + 'core_email_cadence': 'Weekly', |
92 | 95 | }, |
93 | 96 |
|
94 | | - # CASE: Ensure Grading notifications are always delivered via email |
| 97 | + # Ensure Grading core notifications are always delivered via email immediately |
95 | 98 | # and users cannot disable them. |
96 | 99 | 'grading': { |
97 | 100 | 'core_email': True, |
98 | | - 'non_editable': ['email'] |
| 101 | + 'non_editable': ['email'], |
| 102 | + 'core_email_cadence': 'Immediately', |
99 | 103 | } |
100 | 104 | } |
101 | 105 |
|
|
0 commit comments