From 8e1f06aa5915cacf7675c232e04690c1952d2974 Mon Sep 17 00:00:00 2001 From: sundasnoreen12 Date: Thu, 19 Jun 2025 12:05:17 +0500 Subject: [PATCH] feat: added goal reminder new UI --- .../commands/goal_reminder_email.py | 3 + .../edx_ace/goalreminder/email/base_body.html | 90 +++++++ .../edx_ace/goalreminder/email/body.html | 240 ++++++++++-------- .../edx_ace/goalreminder/email/footer.html | 195 ++++++++++++++ .../edx_ace/goalreminder/email/head.html | 55 ++-- lms/envs/common.py | 4 + 6 files changed, 468 insertions(+), 119 deletions(-) create mode 100644 lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/base_body.html create mode 100644 lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/footer.html diff --git a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py index cb7b5cef37..e43fedcb6b 100644 --- a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py +++ b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py @@ -92,6 +92,7 @@ def send_ace_message(goal, session_id): message_context.update({ 'email': user.email, + 'user_name': user.username, 'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME), 'course_name': course_name, 'course_id': str(goal.course_key), @@ -103,6 +104,8 @@ def send_ace_message(goal, session_id): 'omit_unsubscribe_link': True, 'courses_url': getattr(settings, 'ACE_EMAIL_COURSES_URL', None), 'programs_url': getattr(settings, 'ACE_EMAIL_PROGRAMS_URL', None), + 'goal_reminder_banner_url': settings.GOAL_REMINDER_BANNER_URL, + 'goal_reminder_profile_url': settings.GOAL_REMINDER_PROFILE_URL, }) options = { diff --git a/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/base_body.html b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/base_body.html new file mode 100644 index 0000000000..4253f59200 --- /dev/null +++ b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/base_body.html @@ -0,0 +1,90 @@ +{% load django_markup %} +{% load i18n %} + +{% load ace %} + +{% load acetags %} + +{% get_current_language as LANGUAGE_CODE %} +{% get_current_language_bidi as LANGUAGE_BIDI %} + +{# This is preview text that is visible in the inbox view of many email clients but not visible in the actual #} +{# email itself. #} + +
+{% block preview_text %}{% endblock %} +
+ +{% for image_src in channel.tracker_image_sources %} + +{% endfor %} + +{% google_analytics_tracking_pixel %} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/body.html b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/body.html index a94187584d..115a6075eb 100644 --- a/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/body.html +++ b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/body.html @@ -1,4 +1,5 @@ -{% extends 'ace_common/edx_ace/common/base_body.html' %} +{% extends 'course_goals/edx_ace/goalreminder/email/base_body.html' %} + {% load i18n %} {% load django_markup %} {% load static %} @@ -21,119 +22,150 @@ {# email client support for style sheets is pretty spotty, so we have to inline all of these styles #} {# we're using important below to override inline styles and my understanding is for email clients where media queries do not work, they'll simply see the desktop css on their phone #} - - - - - -
- {% include "goal_reminder_banner.html" %} -
 
- -

- {% filter force_escape %}{% blocktrans %} - There’s still time to reach your goal - {% endblocktrans %}{% endfilter %} -

- - - -

- {% filter force_escape %} - {% autoescape off %} - {% blocktrans count count=days_per_week asvar goal_text %} - You set a goal of learning {start_bold}{{days_per_week}} time a week in {{course_name}}{end_bold}. You’re not quite there, but there's still time to reach that goal! - {% plural %} - You set a goal of learning {start_bold}{{days_per_week}} times a week in {{course_name}}{end_bold}. You're not quite there, but there's still time to reach that goal! - {% endblocktrans %} - {% endautoescape %} - {% endfilter %} - {% interpolate_html goal_text start_bold=''|safe end_bold=''|safe %} -

- - - - -

- {% filter force_escape %}{% blocktrans %} - Jump back in - {% endblocktrans %}{% endfilter %} +

+ + + + + + + + + + + + + + + + + -
+ {% trans 'There’s still time to reach your goal' as tmsg %}{{ tmsg | force_escape }} +
+

+ {% blocktrans with user_name=user_name %} + You’re almost there, {{ user_name }}! + {% endblocktrans %} +

+

+ {% filter force_escape %} + {% autoescape off %} + {% blocktrans count count=days_per_week asvar goal_text %} + You set a goal of learning {start_bold}{{days_per_week}} time a week in {{course_name}}{end_bold}. Now it’s up to you to make those goals a reality. + {% plural %} + You set a goal of learning {start_bold}{{days_per_week}} times a week in {{course_name}}{end_bold}. Now it’s up to you to make those goals a reality. + {% endblocktrans %} + {% endautoescape %} + {% endfilter %} + {% interpolate_html goal_text start_bold=''|safe end_bold=''|safe %} +

+
+ + {% filter force_escape %}{% blocktrans %} + Jump back in + {% endblocktrans %}{% endfilter %} + +
+   +
+ + + + + + - - -

-
- {% filter force_escape %}{% blocktrans %} - Remember, you can always change your learning goal. The best goal is one that you can stick to. - {% endblocktrans %}{% endfilter %} -

- - - - -
- {% filter force_escape %}{% blocktrans %} - Adjust my goal - {% endblocktrans %}{% endfilter %} -
-
- -
+ +
+ + +
+

+ {% trans "Remember: the best goal is one that you can stick to. " as tmsg %}{{ tmsg | force_escape }} + {% trans "You can always" as tmsg %}{{ tmsg | force_escape }} + change your learning goal + {% trans "if you need to." as tmsg %}{{ tmsg | force_escape }}

- -
+ Message Icon +
+
+ {% filter force_escape %}{% blocktrans %} Unsubscribe from goal reminder emails for this course {% endblocktrans %}{% endfilter %} - -
- - + + + + {% endblock %} + +{% block footer%} +{%include 'course_goals/edx_ace/goalreminder/email/footer.html'%} +{% endblock%} diff --git a/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/footer.html b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/footer.html new file mode 100644 index 0000000000..82e493276d --- /dev/null +++ b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/footer.html @@ -0,0 +1,195 @@ +{% load django_markup %} +{% load i18n %} +{% load ace %} +{% load acetags %} +{% load static %} + + + + {% if confirm_activation_link %} + {% endif %} + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+ + {% filter force_escape %}{% blocktrans %}Go to {{ platform_name }} Home Page{% endblocktrans %}{% endfilter %} +
+ + + + + + +
+ + + + {% if social_media_urls.facebook %} + + {% endif %} + {% if social_media_urls.instagram %} + + {% endif %} + {% if social_media_urls.linkedin %} + + {% endif %} + {% if social_media_urls.twitter %} + + {% endif %} + {% if social_media_urls.reddit %} + + {% endif %} + + +
+ + {% filter force_escape %}{% blocktrans %}{{ platform_name }} on Facebook{% endblocktrans %}{% endfilter %} + + + + {% filter force_escape %}{% blocktrans %}{{ platform_name }} on Facebook{% endblocktrans %}{% endfilter %} + + + + {% filter force_escape %}{% blocktrans %}{{ platform_name }} on LinkedIn{% endblocktrans %}{% endfilter %} + + + + {% filter force_escape %}{% blocktrans %}{{ platform_name }} on Twitter{% endblocktrans %}{% endfilter %} + + + + {% filter force_escape %}{% blocktrans %}{{ platform_name }} on Reddit{% endblocktrans %}{% endfilter %} + +
+
+
+
+
+ + + + + + +
+ + + + + + +
+ + + + {% if mobile_store_urls.apple %} + + {% endif %} + + {% if mobile_store_urls.google %} + + {% endif %} + + +
+ + {% trans + + + + {% trans + +
+
+
+
+ {% if disclaimer %} + {{ disclaimer }}
+ {% endif %} + {% trans "edX is the trusted platform for education and learning" as tmsg %}{{ tmsg | force_escape }}.
+
+ © {% now "Y" %} {{ platform_name }} LLC. {% trans "All rights reserved" as tmsg %}{{ tmsg | force_escape }}.
+
+ {% if unsubscribe_link %} + + {%if unsubscribe_text%} {{unsubscribe_text}} {%else%} {% trans "Unsubscribe from these emails." as tmsg %}{{ tmsg | force_escape }} {%endif%} +
+
+ {% endif %} + {{ contact_mailing_address }} +
+
+
diff --git a/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/head.html b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/head.html index 23910941b6..565956d137 100644 --- a/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/head.html +++ b/lms/djangoapps/course_goals/templates/course_goals/edx_ace/goalreminder/email/head.html @@ -1,15 +1,40 @@ -{% extends 'ace_common/edx_ace/common/base_head.html' %} -{% block additional_styles %} - -{% endblock %} \ No newline at end of file +{% load django_markup %} +{% load i18n %} +{% load ace %} +{% load acetags %} +{% load static %} + + + + + +
+ + + + +
+ + + + + + +
 
+ + + + +
+ + + + +
+ + {% filter force_escape %}{% blocktrans %}Go to {{ platform_name }} Home Page{% endblocktrans %}{% endfilter %} +
+
+
 
+
+
diff --git a/lms/envs/common.py b/lms/envs/common.py index 7097b4c2a0..95c6d22328 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -5415,6 +5415,10 @@ NOTIFICATION_DIGEST_LOGO = DEFAULT_EMAIL_LOGO_URL SELF_PACED_BANNER_URL = "" SELF_PACED_CLOUD_URL = "" +############## GOAL REMINDER EMAIL ############## +GOAL_REMINDER_BANNER_URL = "" +GOAL_REMINDER_PROFILE_URL = "" + ############## NUDGE EMAILS ############### # .. setting_name: DISABLED_ORGS_FOR_PROGRAM_NUDGE # .. setting_default: []