Skip to content

Commit 5d7f8e4

Browse files
Merge pull request #36897 from openedx/sundas/INF-1919
feat: implemented self paced email UI
2 parents f4c3575 + 2dd3df4 commit 5d7f8e4

8 files changed

Lines changed: 484 additions & 27 deletions

File tree

lms/envs/common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5411,6 +5411,10 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
54115411
DEFAULT_NOTIFICATION_ICON_URL = ""
54125412
NOTIFICATION_DIGEST_LOGO = DEFAULT_EMAIL_LOGO_URL
54135413

5414+
############## SELF PACED EMAIL ##############
5415+
SELF_PACED_BANNER_URL = ""
5416+
SELF_PACED_CLOUD_URL = ""
5417+
54145418
############## NUDGE EMAILS ###############
54155419
# .. setting_name: DISABLED_ORGS_FOR_PROGRAM_NUDGE
54165420
# .. setting_default: []

openedx/core/djangoapps/schedules/resolvers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ def get_schedules(self):
548548
'course_id': str(course.id),
549549
'course_ids': [str(course.id)],
550550
'unsubscribe_url': unsubscribe_url,
551+
'self_paced_banner_url': settings.SELF_PACED_BANNER_URL,
552+
'self_paced_cloud_url': settings.SELF_PACED_CLOUD_URL,
551553
})
552554
template_context.update(_get_upsell_information_for_schedule(user, schedule))
553555

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{% load django_markup %}
2+
{% load i18n %}
3+
<!-- These tags come from the ace_common djangoapp in edx ace -->
4+
{% load ace %}
5+
<!-- These tags come from the edx_ace app within the edx_ace repository -->
6+
{% load acetags %}
7+
8+
{% get_current_language as LANGUAGE_CODE %}
9+
{% get_current_language_bidi as LANGUAGE_BIDI %}
10+
11+
{# This is preview text that is visible in the inbox view of many email clients but not visible in the actual #}
12+
{# email itself. #}
13+
14+
<div lang="{{ LANGUAGE_CODE|default:"en" }}" style="
15+
display:none;
16+
font-size:1px;
17+
line-height:1px;
18+
max-height:0px;
19+
max-width:0px;
20+
opacity:0;
21+
overflow:hidden;
22+
visibility:hidden;
23+
">
24+
{% block preview_text %}{% endblock %}
25+
</div>
26+
27+
{% for image_src in channel.tracker_image_sources %}
28+
<img src="{image_src}" alt="" role="presentation" aria-hidden="true" />
29+
{% endfor %}
30+
31+
{% google_analytics_tracking_pixel %}
32+
33+
<div bgcolor="#F2F0EF" lang="{{ LANGUAGE_CODE|default:"en" }}" dir="{{ LANGUAGE_BIDI|yesno:"rtl,ltr" }}" style="
34+
margin: 0;
35+
padding: 0;
36+
min-width: 100%;
37+
">
38+
<!-- Hack for outlook 2010, which wants to render everything in Times New Roman -->
39+
<!--[if mso]>
40+
<style type="text/css">
41+
body, table, td {font-family: Arial, sans-serif !important;}
42+
</style>
43+
<![endif]-->
44+
45+
<!--[if (gte mso 9)|(IE)]>
46+
<table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0">
47+
<tr>
48+
<td>
49+
<![endif]-->
50+
51+
<!-- CONTENT -->
52+
<table class="content" role="presentation" align="center" cellpadding="0" cellspacing="0" border="0" bgcolor="#fbfaf9" width="100%"
53+
{% block table_style %}
54+
style="
55+
font-family: Arial, sans-serif;
56+
font-size: 1em;
57+
line-height: 1.5;
58+
max-width: 600px;
59+
"
60+
{% endblock %}
61+
>
62+
<tr>
63+
<!-- HEADER -->
64+
<td class="header" style="background-color: #F2F0EF;">
65+
{% block header %}{% endblock %}
66+
</td>
67+
</tr>
68+
69+
<tr>
70+
<!-- MAIN -->
71+
<td class="main" bgcolor="#ffffff">
72+
{% block content %}{% endblock %}
73+
</td>
74+
</tr>
75+
76+
<tr>
77+
<!-- FOOTER -->
78+
<td class="footer" style="padding: 30px; background-color: #F2F0EF;">
79+
{% block footer %}{% endblock %}
80+
</td>
81+
</tr>
82+
83+
</table>
84+
85+
<!--[if (gte mso 9)|(IE)]>
86+
</td>
87+
</tr>
88+
</table>
89+
<![endif]-->
90+
91+
</div>
Lines changed: 113 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
{% extends 'ace_common/edx_ace/common/base_body.html' %}
1+
{% extends 'schedules/edx_ace/courseupdate/email/base_body.html' %}
2+
23
{% load i18n %}
34
{% load django_markup %}
5+
{% load static %}
46

57
{% block preview_text %}
68
{% filter force_escape %}
@@ -11,38 +13,123 @@
1113
{% endblock %}
1214

1315
{% block content %}
14-
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
16+
<table width="100%" style="margin-bottom: 30px;" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
17+
<style>
18+
.course-text{
19+
span{
20+
padding-left: 12px;
21+
padding-right: 12px;
22+
padding-top: 10px;
23+
padding-bottom: 10px;
24+
}
25+
}
26+
</style>
27+
{% if route_enabled %}
1528
<tr>
1629
<td>
17-
<p>
18-
{% blocktrans trimmed asvar tmsg %}
19-
We hope you're enjoying {start_strong}{course_name}{end_strong}!
20-
We want to let you know what you can look forward to in week {week_num}:
21-
{% endblocktrans %}
22-
{% interpolate_html tmsg start_strong='<strong>'|safe end_strong='</strong>'|safe course_name=course_name|force_escape|safe week_num=week_num|force_escape|safe %}
23-
<ul>
24-
{% for highlight in week_highlights %}
25-
<li>{{ highlight }}</li>
26-
{% endfor %}
27-
</ul>
28-
</p>
2930
<p>
3031
{% filter force_escape %}
31-
{% blocktrans trimmed %}
32-
With self-paced courses, you learn on your own schedule.
33-
We encourage you to spend time with the course each week.
34-
Your focused attention will pay off in the end!
35-
{% endblocktrans %}
32+
{% blocktrans %}This is a routed Account Activation email for {{ routed_profile_name }} ({{ routed_user_email }}): {{ routed_profile_name }}{% endblocktrans %}
3633
{% endfilter %}
34+
<br />
3735
</p>
38-
39-
{% filter force_escape %}
40-
{% blocktrans asvar course_cta_text %}Resume your course now{% endblocktrans %}
41-
{% endfilter %}
42-
{% include "ace_common/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
43-
44-
{% include "ace_common/edx_ace/common/upsell_cta.html"%}
4536
</td>
4637
</tr>
38+
{% endif %}
39+
<tr>
40+
<td>
41+
<img
42+
src="{{ self_paced_banner_url }}"
43+
style="margin-bottom: 16px; width: 600px;"
44+
width= "600"
45+
height="265"
46+
alt="{% trans 'Welcome to edX. It’s time for your next career move' as tmsg %}{{ tmsg | force_escape }}"
47+
/>
48+
</td>
49+
</tr>
50+
<tr>
51+
<td>
52+
<p style="margin-top: 16px; color: #1F453D; font-family: Arial; font-size: 30px; font-weight: 700; line-height: 36px; margin-left: 30px;">
53+
{% trans "We hope you’re enjoying Introduction to Data Science with Python!" as tmsg %}{{ tmsg | force_escape }}
54+
</p>
55+
<p style="margin-top: 16px; color: #000000; font-family: Arial; font-size: 16px; font-weight: 400; line-height: 24px; margin-left: 30px;">
56+
{% trans "We want to let you know what you can look forward to in week two: " as tmsg %}{{ tmsg | force_escape }}
57+
</p>
58+
<ul style="margin-bottom: 16px; list-style: disc;">
59+
<li>
60+
<p>
61+
{% trans "Learn kNN regression" as tmsg %}{{ tmsg | force_escape }}
62+
</p>
63+
</li>
64+
<li>
65+
<p>
66+
{% trans "Learn linear regression" as tmsg %}{{ tmsg | force_escape }}
67+
</p>
68+
</li>
69+
<li>
70+
<p>
71+
{% trans "Find out how to choose which model you want" as tmsg %}{{ tmsg | force_escape }}
72+
</p>
73+
</li>
74+
</ul>
75+
</td>
76+
</tr>
77+
<tr style="height: 32px;">
78+
<td style="padding-top: 1rem;" class="course-text">
79+
{% filter force_escape %}
80+
{% blocktrans asvar course_cta_text %}Resume your course {% endblocktrans %}
81+
{% endfilter %}
82+
{% include "schedules/edx_ace/courseupdate/email/return_to_course_cta.html" with course_cta_text=course_cta_text%}
83+
</td>
84+
</tr>
85+
<tr>
86+
<td style="height: 32px; line-height: 32px; font-size: 1px;">
87+
&nbsp;
88+
</td>
89+
</tr>
90+
91+
<tr style="background-color: #F3F1ED;">
92+
<td>
93+
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width: 540px; border-radius: 8px;" bgcolor="#F3F1ED" class="goals-engage-table" align="left">
94+
<!-- Row 1: Image and title -->
95+
<!--[if mso]>
96+
<tr>
97+
<td style="width: 400px; color: #1F453D; font-size: 16px; font-family: Arial, Helvetica, sans-serif; font-weight: 400; line-height: 24px; width: 100%;">
98+
<p style="padding: 20px 30px; margin-left: 30px">
99+
<strong>
100+
{% trans "Your focused attention will pay off in the end!" as tmsg %}{{ tmsg | force_escape }}
101+
</strong>
102+
{% trans "With self-paced courses, you learn on your own schedule. It’s a good idea to spend time with the course each week and check in with your goals often." as tmsg %}{{ tmsg | force_escape }}
103+
</p>
104+
</td>
105+
<td width="120" style="width: 120px; padding: 0; margin: 0; vertical-align: top;">
106+
<img src="{{ self_paced_cloud_url }}"
107+
alt="Message Icon"
108+
width="120"
109+
height="158"
110+
style="display: block; border: 0; margin: 0; padding: 0; width: 120px; height: 158px; max-width: 120px !important; max-height: 158px !important;" />
111+
</td>
112+
</tr>
113+
<![endif]-->
114+
<!--[if !mso]><!-->
115+
<tr>
116+
<td style="width: 400px; color: #1F453D; font-size: 16px; font-family: Arial, sans-serif; font-weight: 400; line-height: 24px;">
117+
<p style="padding: 20px 30px; margin: 0px;">
118+
<strong> {% trans "Your focused attention will pay off in the end! " as tmsg %}{{ tmsg | force_escape }} </strong>
119+
{% trans "With self-paced courses, you learn on your own schedule. It’s a good idea to spend time with the course each week and check in with your goals often." as tmsg %}{{ tmsg | force_escape }}
120+
</p>
121+
</td>
122+
<td style="padding: 0; margin: 0;" align="left" valign="top">
123+
<img src="{{ self_paced_cloud_url }}" alt="Message Icon" style="display: block; border: 0; margin: 0; padding: 0; width: 120px; height: 158px; margin-top: -40px;">
124+
</td>
125+
</tr>
126+
<!--<![endif]-->
127+
</table>
128+
</td>
129+
</tr>
47130
</table>
48131
{% endblock %}
132+
133+
{% block footer%}
134+
{%include 'schedules/edx_ace/courseupdate/email/footer.html'%}
135+
{% endblock%}

0 commit comments

Comments
 (0)