From 2104fad77a9d75467bf46e5289d2330d25736360 Mon Sep 17 00:00:00 2001
From: Muhammad Adeel Tajamul
Date: Thu, 29 Feb 2024 14:39:44 +0500
Subject: [PATCH 1/8] feat: added edx-ace template and message type for email
notifications
---
lms/envs/common.py | 3 +-
.../notifications/email/message_type.py | 15 ++++
.../djangoapps/notifications/email/utils.py | 82 +++++++++++++++++++
.../notifications/digest_content.html | 45 ++++++++++
.../notifications/digest_footer.html | 48 +++++++++++
.../notifications/digest_header.html | 47 +++++++++++
.../edx_ace/email_digest/email/body.html | 0
.../edx_ace/email_digest/email/body.txt | 22 +++++
.../edx_ace/email_digest/email/from_name.txt | 1 +
.../edx_ace/email_digest/email/head.html | 0
.../edx_ace/email_digest/email/subject.txt | 1 +
11 files changed, 263 insertions(+), 1 deletion(-)
create mode 100644 openedx/core/djangoapps/notifications/email/message_type.py
create mode 100644 openedx/core/djangoapps/notifications/email/utils.py
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/from_name.txt
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html
create mode 100644 openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/subject.txt
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 2ff6621a0d19..f3dc23020e27 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -5387,10 +5387,11 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
SUBSCRIPTIONS_TRIAL_LENGTH = 7
SUBSCRIPTIONS_SERVICE_WORKER_USERNAME = 'subscriptions_worker'
-############## NOTIFICATIONS EXPIRY ##############
+############## NOTIFICATIONS ##############
NOTIFICATIONS_EXPIRY = 60
EXPIRED_NOTIFICATIONS_DELETE_BATCH_SIZE = 10000
NOTIFICATION_CREATION_BATCH_SIZE = 99
+NOTIFICATIONS_DEFAULT_FROM_EMAIL = "no-reply@example.com"
############################ AI_TRANSLATIONS ##################################
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'
diff --git a/openedx/core/djangoapps/notifications/email/message_type.py b/openedx/core/djangoapps/notifications/email/message_type.py
new file mode 100644
index 000000000000..1831a79cedc7
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/email/message_type.py
@@ -0,0 +1,15 @@
+"""
+Email notifications MessageType
+"""
+from django.conf import settings
+from edx_ace.message import MessageType
+
+
+class EmailNotificationMessageType(MessageType):
+
+ NAME = "notifications"
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.options['transactional'] = True
+ self.options['from_address'] = settings.NOTIFICATIONS_DEFAULT_FROM_EMAIL
diff --git a/openedx/core/djangoapps/notifications/email/utils.py b/openedx/core/djangoapps/notifications/email/utils.py
new file mode 100644
index 000000000000..2b666d2125c7
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/email/utils.py
@@ -0,0 +1,82 @@
+"""
+Email Notifications Utils
+"""
+from django.conf import settings
+from lms.djangoapps.branding.api import get_logo_url_for_email
+
+
+def create_datetime_string(datetime_instance):
+ return datetime_instance.strftime('%A, %b %d')
+
+
+def get_icon_url_for_notification_type(notification_type):
+ """
+ Returns icon url for notification type
+ """
+ check_circle_green = "https://edx-notifications-static.edx.org/icons/check_circle_green.png"
+ help_outline = "https://edx-notifications-static.edx.org/icons/help_outline.png"
+ newspaper = "https://edx-notifications-static.edx.org/icons/newspaper.png"
+ post_outline = "https://edx-notifications-static.edx.org/icons/post_outline.png"
+ question_answer_outline = "https://edx-notifications-static.edx.org/icons/question_answer_outline.png"
+ report_red = "https://edx-notifications-static.edx.org/icons/report_red.png"
+ verified = "https://edx-notifications-static.edx.org/icons/verified.png"
+ notification_type_dict = {
+ "new_comment_on_response": question_answer_outline,
+ "new_comment": question_answer_outline,
+ "new_response": question_answer_outline,
+ "new_discussion_post": post_outline,
+ "new_question_post": help_outline,
+ "response_on_followed_post": question_answer_outline,
+ "comment_on_followed_post": question_answer_outline,
+ "content_reported": report_red,
+ "response_endorsed_on_thread": verified,
+ "response_endorsed": check_circle_green,
+ "course_update": newspaper,
+ }
+ return notification_type_dict.get(notification_type, post_outline)
+
+
+def create_email_template_context():
+ """
+ Creates email context for header and footer
+ """
+ social_media_urls = settings.SOCIAL_MEDIA_FOOTER_ACE_URLS
+ social_media_icons = settings.SOCIAL_MEDIA_LOGO_URLS
+ social_media_info = {
+ social_platform: {
+ 'url': social_media_urls[social_platform],
+ 'icon': social_media_icons[social_platform]
+ }
+ for social_platform in social_media_urls.keys()
+ if social_media_icons.get(social_platform)
+ }
+ return {
+ "platform_name": settings.PLATFORM_NAME,
+ "logo_url": get_logo_url_for_email(),
+ "social_media": social_media_info,
+ "notification_settings_url": f"{settings.ACCOUNT_MICROFRONTEND_URL}/notifications",
+ }
+
+
+def create_email_digest_content(start_date, end_date=None, digest_frequency="Daily",
+ notifications_count=0, updates_count=0, email_content=[]):
+ """
+ Creates email context based on content
+ start_date: datetime instance
+ end_date: datetime instance
+ """
+ context = create_email_template_context()
+ start_date_str = create_datetime_string(start_date)
+ end_date_str = create_datetime_string(end_date if end_date else start_date)
+ context.update({
+ "start_date": start_date_str,
+ "end_date": end_date_str,
+ "digest_frequency": digest_frequency,
+ "updates": [
+ {"count": updates_count, "type": "Updates"},
+ {"count": notifications_count, "type": "Notifications"}
+ ],
+ "email_content": email_content,
+ "get_icon_url_for_notification_type": get_icon_url_for_notification_type,
+ })
+ return context
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
new file mode 100644
index 000000000000..e4e5dc2fc245
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
@@ -0,0 +1,45 @@
+
+ {% for update in email_content %}
+
+ {{ update.title }}
+
+ {% if update.help_text %}
+ {{ update.help_text }}
+ {% if update.help_text_url %}
+
+
+ View all
+
+
+ {% endif %}
+ {% endif %}
+
+
+
+ {% for content in update.content %}
+
+
+
+ |
+
+
+ {{ content.title }}
+
+
+ {{ content.course_name }}
+ ·
+ {{ content.time_ago }}
+
+
+ View
+
+
+
+ |
+
+ {% endfor %}
+
+
+
+ {% endfor %}
+
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
new file mode 100644
index 000000000000..e9de8b60b942
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ {% for social_name, social_data in social_media.items %}
+
+
+
+
+ |
+ {% endfor %}
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+ You are receiving this email because you have subscribed to email digest
+
+
+
+ Notification Settings
+
+
+
+ © 2023 edX LLC. All Rights Reserved
+ 7900 Harkins Road, Lanham MD 20706
+
+ |
+
+
+
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
new file mode 100644
index 000000000000..2d606dd2b2a7
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+ |
+
+
+
+ {{ digest_frequency }} email digest
+ |
+
+
+
+ {{ start_date }} {% if digest_frequency == "Weekly" %} - {{ end_date }} {% endif %}
+ |
+
+
+
+
+
+
+ {% for update in updates %}
+
+
+
+
+
+ {{update.count}}
+ |
+
+
+
+ {{update.type}}
+ |
+
+
+
+ |
+ {% endfor %}
+
+
+
+ |
+
+
+
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt
new file mode 100644
index 000000000000..c7b79df30880
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt
@@ -0,0 +1,22 @@
+
+
+
+
+
+ {% include 'notifications/digest_header.html' %}
+ |
+
+
+
+ {% include 'notifications/digest_content.html' %}
+ |
+
+
+
+ {% include 'notifications/digest_footer.html' %}
+ |
+
+
+
+
+
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/from_name.txt b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/from_name.txt
new file mode 100644
index 000000000000..dcbc23c00480
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/from_name.txt
@@ -0,0 +1 @@
+{{ platform_name }}
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/subject.txt b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/subject.txt
new file mode 100644
index 000000000000..3bbe26faf772
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/subject.txt
@@ -0,0 +1 @@
+{{ digest_frequency }} Notifications Digest for {% if digest_frequency == "Weekly" %}the Week of {% endif %}{{ start_date }}
From 5f74fe1d9b03d5a0246826bc5c8ab07181804324 Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Fri, 1 Mar 2024 10:07:00 +0500
Subject: [PATCH 2/8] chore: added init file
---
openedx/core/djangoapps/notifications/email/__init__.py | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 openedx/core/djangoapps/notifications/email/__init__.py
diff --git a/openedx/core/djangoapps/notifications/email/__init__.py b/openedx/core/djangoapps/notifications/email/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
From 366ecd595c10d85d794c6b2d777d84bd4aad2f0a Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Fri, 1 Mar 2024 10:46:09 +0500
Subject: [PATCH 3/8] fix: fixed mako-missing-default
---
.../templates/notifications/edx_ace/email_digest/email/body.html | 1 +
.../templates/notifications/edx_ace/email_digest/email/head.html | 1 +
2 files changed, 2 insertions(+)
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html
index e69de29bb2d1..c847f75e4f7b 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.html
@@ -0,0 +1 @@
+<%page expression_filter="h"/>
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html
index e69de29bb2d1..c847f75e4f7b 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/head.html
@@ -0,0 +1 @@
+<%page expression_filter="h"/>
From a6a938fcb6aa2251e175961a5c229fcdaf9e26d2 Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Fri, 1 Mar 2024 12:38:46 +0500
Subject: [PATCH 4/8] fix: fixed pylint errors
---
openedx/core/djangoapps/notifications/email/message_type.py | 3 +++
openedx/core/djangoapps/notifications/email/utils.py | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/openedx/core/djangoapps/notifications/email/message_type.py b/openedx/core/djangoapps/notifications/email/message_type.py
index 1831a79cedc7..655363248bbe 100644
--- a/openedx/core/djangoapps/notifications/email/message_type.py
+++ b/openedx/core/djangoapps/notifications/email/message_type.py
@@ -6,6 +6,9 @@
class EmailNotificationMessageType(MessageType):
+ """
+ Edx-ace MessageType for Email Notifications
+ """
NAME = "notifications"
diff --git a/openedx/core/djangoapps/notifications/email/utils.py b/openedx/core/djangoapps/notifications/email/utils.py
index 2b666d2125c7..7b5f2a6d0711 100644
--- a/openedx/core/djangoapps/notifications/email/utils.py
+++ b/openedx/core/djangoapps/notifications/email/utils.py
@@ -59,7 +59,7 @@ def create_email_template_context():
def create_email_digest_content(start_date, end_date=None, digest_frequency="Daily",
- notifications_count=0, updates_count=0, email_content=[]):
+ notifications_count=0, updates_count=0, email_content=None):
"""
Creates email context based on content
start_date: datetime instance
@@ -76,7 +76,7 @@ def create_email_digest_content(start_date, end_date=None, digest_frequency="Dai
{"count": updates_count, "type": "Updates"},
{"count": notifications_count, "type": "Notifications"}
],
- "email_content": email_content,
+ "email_content": email_content if email_content else [],
"get_icon_url_for_notification_type": get_icon_url_for_notification_type,
})
return context
From ac0a7d67702d250f19de847ccde34ebb77edbfcf Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Mon, 4 Mar 2024 14:47:12 +0500
Subject: [PATCH 5/8] chore: moved icons url to env
---
lms/envs/common.py | 2 +
.../notifications/email/notification_icons.py | 45 +++++++++++++++++++
.../djangoapps/notifications/email/utils.py | 23 +---------
3 files changed, 49 insertions(+), 21 deletions(-)
create mode 100644 openedx/core/djangoapps/notifications/email/notification_icons.py
diff --git a/lms/envs/common.py b/lms/envs/common.py
index f3dc23020e27..28dfa0706614 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -5392,6 +5392,8 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
EXPIRED_NOTIFICATIONS_DELETE_BATCH_SIZE = 10000
NOTIFICATION_CREATION_BATCH_SIZE = 99
NOTIFICATIONS_DEFAULT_FROM_EMAIL = "no-reply@example.com"
+NOTIFICATION_TYPE_ICONS = {}
+DEFAULT_NOTIFICATION_ICON_URL = "https://edx-notifications-static.edx.org/icons/newspaper.png"
############################ AI_TRANSLATIONS ##################################
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'
diff --git a/openedx/core/djangoapps/notifications/email/notification_icons.py b/openedx/core/djangoapps/notifications/email/notification_icons.py
new file mode 100644
index 000000000000..0336a43a817f
--- /dev/null
+++ b/openedx/core/djangoapps/notifications/email/notification_icons.py
@@ -0,0 +1,45 @@
+"""
+Notification Icons
+"""
+from django.conf import settings
+
+
+class NotificationTypeIcons:
+ """
+ Notification Mapping with icons
+ """
+ CHECK_CIRCLE_GREEN = "CHECK_CIRCLE_GREEN"
+ HELP_OUTLINE = "HELP_OUTLINE"
+ NEWSPAPER = "NEWSPAPER"
+ POST_OUTLINE = "POST_OUTLINE"
+ QUESTION_ANSWER_OUTLINE = "QUESTION_ANSWER_OUTLINE"
+ REPORT_RED = "REPORT_RED"
+ VERIFIED = "VERIFIED"
+
+ @classmethod
+ def get_icon_name_for_notification_type(cls, notification_type, default="POST_OUTLINE"):
+ """
+ Returns icon name for notification type
+ """
+ notification_type_dict = {
+ "new_comment_on_response": cls.QUESTION_ANSWER_OUTLINE,
+ "new_comment": cls.QUESTION_ANSWER_OUTLINE,
+ "new_response": cls.QUESTION_ANSWER_OUTLINE,
+ "new_discussion_post": cls.POST_OUTLINE,
+ "new_question_post": cls.HELP_OUTLINE,
+ "response_on_followed_post": cls.QUESTION_ANSWER_OUTLINE,
+ "comment_on_followed_post": cls.QUESTION_ANSWER_OUTLINE,
+ "content_reported": cls.REPORT_RED,
+ "response_endorsed_on_thread": cls.VERIFIED,
+ "response_endorsed": cls.CHECK_CIRCLE_GREEN,
+ "course_update": cls.NEWSPAPER,
+ }
+ return notification_type_dict.get(notification_type, default)
+
+ @classmethod
+ def get_icon_url_for_notification_type(cls, notification_type):
+ """
+ Returns icon url for notification type
+ """
+ icon_name = cls.get_icon_name_for_notification_type(notification_type)
+ return settings.NOTIFICATION_TYPE_ICONS.get(icon_name, settings.DEFAULT_NOTIFICATION_ICON_URL)
diff --git a/openedx/core/djangoapps/notifications/email/utils.py b/openedx/core/djangoapps/notifications/email/utils.py
index 7b5f2a6d0711..5a6bef9e29c4 100644
--- a/openedx/core/djangoapps/notifications/email/utils.py
+++ b/openedx/core/djangoapps/notifications/email/utils.py
@@ -3,6 +3,7 @@
"""
from django.conf import settings
from lms.djangoapps.branding.api import get_logo_url_for_email
+from .notification_icons import NotificationTypeIcons
def create_datetime_string(datetime_instance):
@@ -13,27 +14,7 @@ def get_icon_url_for_notification_type(notification_type):
"""
Returns icon url for notification type
"""
- check_circle_green = "https://edx-notifications-static.edx.org/icons/check_circle_green.png"
- help_outline = "https://edx-notifications-static.edx.org/icons/help_outline.png"
- newspaper = "https://edx-notifications-static.edx.org/icons/newspaper.png"
- post_outline = "https://edx-notifications-static.edx.org/icons/post_outline.png"
- question_answer_outline = "https://edx-notifications-static.edx.org/icons/question_answer_outline.png"
- report_red = "https://edx-notifications-static.edx.org/icons/report_red.png"
- verified = "https://edx-notifications-static.edx.org/icons/verified.png"
- notification_type_dict = {
- "new_comment_on_response": question_answer_outline,
- "new_comment": question_answer_outline,
- "new_response": question_answer_outline,
- "new_discussion_post": post_outline,
- "new_question_post": help_outline,
- "response_on_followed_post": question_answer_outline,
- "comment_on_followed_post": question_answer_outline,
- "content_reported": report_red,
- "response_endorsed_on_thread": verified,
- "response_endorsed": check_circle_green,
- "course_update": newspaper,
- }
- return notification_type_dict.get(notification_type, post_outline)
+ return NotificationTypeIcons.get_icon_url_for_notification_type(notification_type)
def create_email_template_context():
From a2c9c260fe301d83757bc8f93aa398fd04693a85 Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Fri, 15 Mar 2024 09:37:49 +0500
Subject: [PATCH 6/8] fix: updated_ui
---
lms/envs/common.py | 3 +-
.../djangoapps/notifications/email/utils.py | 1 +
.../notifications/digest_content.html | 85 ++++++++++---------
.../notifications/digest_footer.html | 16 ++--
.../notifications/digest_header.html | 65 +++++++++-----
.../edx_ace/email_digest/email/body.txt | 8 +-
6 files changed, 108 insertions(+), 70 deletions(-)
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 28dfa0706614..09428f8f5774 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -5393,7 +5393,8 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
NOTIFICATION_CREATION_BATCH_SIZE = 99
NOTIFICATIONS_DEFAULT_FROM_EMAIL = "no-reply@example.com"
NOTIFICATION_TYPE_ICONS = {}
-DEFAULT_NOTIFICATION_ICON_URL = "https://edx-notifications-static.edx.org/icons/newspaper.png"
+NOTIFICATION_ASSETS_ROOT_URL = ""
+DEFAULT_NOTIFICATION_ICON_URL = ""
############################ AI_TRANSLATIONS ##################################
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'
diff --git a/openedx/core/djangoapps/notifications/email/utils.py b/openedx/core/djangoapps/notifications/email/utils.py
index 5a6bef9e29c4..2993b68fc2dd 100644
--- a/openedx/core/djangoapps/notifications/email/utils.py
+++ b/openedx/core/djangoapps/notifications/email/utils.py
@@ -33,6 +33,7 @@ def create_email_template_context():
}
return {
"platform_name": settings.PLATFORM_NAME,
+ "mailing_address": settings.CONTACT_MAILING_ADDRESS,
"logo_url": get_logo_url_for_email(),
"social_media": social_media_info,
"notification_settings_url": f"{settings.ACCOUNT_MICROFRONTEND_URL}/notifications",
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
index e4e5dc2fc245..7e705d35a3e0 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
@@ -1,45 +1,54 @@
-
- {% for update in email_content %}
-
- {{ update.title }}
-
- {% if update.help_text %}
- {{ update.help_text }}
+{% for update in email_content %}
+
+ {{ update.title }}
+
+ {% if update.help_text %}
+
+
+ {{ update.help_text }}
+
{% if update.help_text_url %}
-
+
View all
{% endif %}
- {% endif %}
-
-
-
- {% for content in update.content %}
-
-
-
- |
-
-
- {{ content.title }}
-
-
- {{ content.course_name }}
- ·
- {{ content.time_ago }}
-
-
- View
-
-
-
- |
-
- {% endfor %}
-
-
- {% endfor %}
-
+ {% endif %}
+
+
+
+
+ {% for content in update.content %}
+
+
+
+ |
+
+
+ {{ content.title }}
+
+
+
+ {{ content.course_name }}
+ ·
+ {{ content.time_ago }}
+
+
+
+ View
+
+
+
+ |
+
+ {% endfor %}
+
+
+
+
+{% endfor %}
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
index e9de8b60b942..d2ded593ed25 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
@@ -1,21 +1,21 @@
-
+
-
+ |
|
-
+ |
{% for social_name, social_data in social_media.items %}
-
+
|
{% endfor %}
@@ -30,17 +30,17 @@
-
+
You are receiving this email because you have subscribed to email digest
-
+
Notification Settings
- © 2023 edX LLC. All Rights Reserved
- 7900 Harkins Road, Lanham MD 20706
+ © {% now "Y" %} {{ platform_name }}. All Rights Reserved
+ {{ mailing_address }}
|
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
index 2d606dd2b2a7..ba726e968be7 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
@@ -1,41 +1,68 @@
-
+
-
+
|
+
-
+ |
{{ digest_frequency }} email digest
|
+
-
+ |
{{ start_date }} {% if digest_frequency == "Weekly" %} - {{ end_date }} {% endif %}
|
+
-
+
{% for update in updates %}
-
-
-
-
- {{update.count}}
- |
-
-
-
- {{update.type}}
- |
-
-
-
+
+
+
+
+
+ {{update.count}}
+ |
+
+
+
+ {{update.type}}
+ |
+
+
+
+
|
{% endfor %}
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt
index c7b79df30880..e45fd8029e2d 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt
+++ b/openedx/core/djangoapps/notifications/templates/notifications/edx_ace/email_digest/email/body.txt
@@ -1,5 +1,5 @@
-
-
+
+
@@ -7,12 +7,12 @@
|
-
+ |
{% include 'notifications/digest_content.html' %}
|
-
+ |
{% include 'notifications/digest_footer.html' %}
|
From c715425eeaa74745646af8a0b6297a0b992e37cf Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Mon, 18 Mar 2024 17:14:03 +0500
Subject: [PATCH 7/8] fix: updated header footer and content ui
---
.../templates/notifications/digest_content.html | 7 ++++---
.../templates/notifications/digest_footer.html | 10 +++++-----
.../templates/notifications/digest_header.html | 11 ++++++-----
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
index 7e705d35a3e0..aa1ee903ad7e 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_content.html
@@ -18,7 +18,7 @@
-
+
{% for content in update.content %}
@@ -28,11 +28,12 @@
-
+ |
{{ content.title }}
-
+
+
{{ content.course_name }}
·
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
index d2ded593ed25..bcd5c0849346 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_footer.html
@@ -5,15 +5,15 @@
-
+ |
|
-
+ |
{% for social_name, social_data in social_media.items %}
-
+ |
@@ -30,10 +30,10 @@
|
-
+
You are receiving this email because you have subscribed to email digest
-
+
Notification Settings
diff --git a/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html b/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
index ba726e968be7..fc91d77fa0bf 100644
--- a/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
+++ b/openedx/core/djangoapps/notifications/templates/notifications/digest_header.html
@@ -45,18 +45,19 @@
>
-
+ |
{{update.count}}
|
-
+ |
{{update.type}}
|
From e680d1b54bd13f750048854a2bf5649edb5d6e3b Mon Sep 17 00:00:00 2001
From: muhammadadeeltajamul
Date: Tue, 19 Mar 2024 13:17:33 +0500
Subject: [PATCH 8/8] fix: updated env variables
---
lms/envs/common.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 09428f8f5774..e41a9b131b95 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -5393,7 +5393,6 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
NOTIFICATION_CREATION_BATCH_SIZE = 99
NOTIFICATIONS_DEFAULT_FROM_EMAIL = "no-reply@example.com"
NOTIFICATION_TYPE_ICONS = {}
-NOTIFICATION_ASSETS_ROOT_URL = ""
DEFAULT_NOTIFICATION_ICON_URL = ""
############################ AI_TRANSLATIONS ##################################
| | | | | |