diff --git a/cms/envs/common.py b/cms/envs/common.py index 6619adbb43..8d3236f7fe 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1677,6 +1677,9 @@ INSTALLED_APPS = [ # Content Library LTI 1.3 Support. 'pylti1p3.contrib.django.lti1p3_tool_config', + + # For edx ace template tags + 'edx_ace', ] 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 2d4b8c51e5..032eda2f36 100644 --- a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py +++ b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py @@ -51,13 +51,27 @@ def send_ace_message(goal): site = Site.objects.get_current() message_context = get_base_template_context(site) - course_home_url = get_learning_mfe_home_url(course_key=goal.course_key) + course_home_url = get_learning_mfe_home_url(course_key=goal.course_key, view_name='home') goals_unsubscribe_url = settings.LEARNING_MICROFRONTEND_URL + reverse( 'course-home:unsubscribe-from-course-goal', kwargs={'token': goal.unsubscribe_token} ) + language = get_user_preference(user, LANGUAGE_KEY) + + # Code to allow displaying different banner images for different languages + # However, we'll likely want to develop a better way to do this within edx-ace + image_url = settings.STATIC_URL + if image_url: + # If the image url is a relative url prepend the LMS ROOT + if 'http' not in image_url: + image_url = settings.LMS_ROOT_URL + settings.STATIC_URL + image_url += 'images/' + + if language and language in ['es', 'es-419']: + image_url += 'spanish-' + message_context.update({ 'email': user.email, 'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME), @@ -65,15 +79,16 @@ def send_ace_message(goal): 'days_per_week': goal.days_per_week, 'course_url': course_home_url, 'goals_unsubscribe_url': goals_unsubscribe_url, - 'image_url': settings.LMS_ROOT_URL + settings.STATIC_URL, + 'image_url': image_url, 'unsubscribe_url': None, # We don't want to include the default unsubscribe link + 'omit_unsubscribe_link': True, }) msg = Message( name="goalreminder", app_label="course_goals", recipient=Recipient(user.id, user.email), - language=get_user_preference(user, LANGUAGE_KEY), + language=language, context=message_context, options={'transactional': True}, ) diff --git a/lms/envs/common.py b/lms/envs/common.py index 9e6438f8bc..765b50775b 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3188,6 +3188,9 @@ INSTALLED_APPS = [ # Content Library LTI 1.3 Support. 'pylti1p3.contrib.django.lti1p3_tool_config', + + # For edx ace template tags + 'edx_ace', ] ######################### CSRF ######################################### diff --git a/lms/static/images/goalreminder-desktop-hero.png b/lms/static/images/goalreminder-desktop-hero.png index 02917c2c4e..ab3fe71c6e 100644 Binary files a/lms/static/images/goalreminder-desktop-hero.png and b/lms/static/images/goalreminder-desktop-hero.png differ diff --git a/lms/static/images/goalreminder-mobile-hero.png b/lms/static/images/goalreminder-mobile-hero.png index 367b0afa14..41e6f3eb10 100644 Binary files a/lms/static/images/goalreminder-mobile-hero.png and b/lms/static/images/goalreminder-mobile-hero.png differ diff --git a/lms/static/images/spanish-goalreminder-desktop-hero.png b/lms/static/images/spanish-goalreminder-desktop-hero.png new file mode 100644 index 0000000000..d1f6ef57f8 Binary files /dev/null and b/lms/static/images/spanish-goalreminder-desktop-hero.png differ diff --git a/lms/static/images/spanish-goalreminder-mobile-hero.png b/lms/static/images/spanish-goalreminder-mobile-hero.png new file mode 100644 index 0000000000..df3348a728 Binary files /dev/null and b/lms/static/images/spanish-goalreminder-mobile-hero.png differ diff --git a/lms/templates/goal_reminder_banner.html b/lms/templates/goal_reminder_banner.html index f380795da5..3b07c5605c 100644 --- a/lms/templates/goal_reminder_banner.html +++ b/lms/templates/goal_reminder_banner.html @@ -1,59 +1,20 @@ -{% load i18n %} {# 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 #} -
-
- -

- {% filter force_escape %}{% blocktrans %} - You’re almost there! - {% endblocktrans %}{% endfilter %} -

-
-
\ No newline at end of file +{% if image_url %} +
+
+{% endif %} \ No newline at end of file diff --git a/openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html b/openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html index c122ebaf47..f72dd3aee1 100644 --- a/openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html +++ b/openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html @@ -1,5 +1,8 @@ {% load i18n %} + {% load ace %} + +{% load acetags %} {% get_current_language as LANGUAGE_CODE %} {% get_current_language_bidi as LANGUAGE_BIDI %} @@ -159,7 +162,8 @@ - {% for action_link_url, action_link_text in channel.action_links %} + {% get_action_links channel omit_unsubscribe_link=omit_unsubscribe_link as action_links %} + {% for action_link_url, action_link_text in action_links %}

{{ action_link_text }} diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 8e84e6567f..b1d04790ca 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -384,7 +384,7 @@ drf-jwt==1.19.1 # via edx-drf-extensions drf-yasg==1.20.0 # via edx-api-doc-tools -edx-ace==1.3.1 +edx-ace==1.4.0 # via -r requirements/edx/base.in edx-api-doc-tools==1.5.0 # via -r requirements/edx/base.in diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 9a7fa5500e..9c8d6fa467 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -489,7 +489,7 @@ drf-yasg==1.20.0 # via # -r requirements/edx/testing.txt # edx-api-doc-tools -edx-ace==1.3.1 +edx-ace==1.4.0 # via -r requirements/edx/testing.txt edx-api-doc-tools==1.5.0 # via -r requirements/edx/testing.txt diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index e1863c3c39..46f835ef69 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -470,7 +470,7 @@ drf-yasg==1.20.0 # via # -r requirements/edx/base.txt # edx-api-doc-tools -edx-ace==1.3.1 +edx-ace==1.4.0 # via -r requirements/edx/base.txt edx-api-doc-tools==1.5.0 # via -r requirements/edx/base.txt