Commit a7c4ddfe by Nimisha Asthagiri Committed by GitHub

Merge pull request #16338 from edx/pacing/course-update

Schedules: Add upsell to Course Update templates
parents 8dc47f57 eb3e173d
......@@ -312,6 +312,8 @@ class TestSendRecurringNudge(FilteredQueryCountMixin, CacheIsolationTestCase):
for (_name, (_msg, email), _kwargs) in mock_channel.deliver.mock_calls:
for template in attr.astuple(email):
self.assertNotIn("TEMPLATE WARNING", template)
self.assertNotIn("{{", template)
self.assertNotIn("}}", template)
def test_user_in_course_with_verified_coursemode_receives_upsell(self):
user = UserFactory.create()
......
......@@ -344,7 +344,7 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
for schedule in schedules:
enrollment = schedule.enrollment
try:
week_summary = get_course_week_summary(enrollment.course_id, week_num)
week_highlights = get_week_highlights(enrollment.course_id, week_num)
except CourseUpdateDoesNotExist:
continue
......@@ -357,7 +357,7 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
self.site, reverse('course_root', args=[course_id_str])
),
'week_num': week_num,
'week_summary': week_summary,
'week_highlights': week_highlights,
# This is used by the bulk email optout policy
'course_ids': [course_id_str],
......@@ -368,9 +368,9 @@ class CourseUpdateResolver(BinnedSchedulesBaseResolver):
@request_cached
def get_course_week_summary(course_id, week_num):
def get_week_highlights(course_id, week_num):
if COURSE_UPDATE_WAFFLE_FLAG.is_enabled(course_id):
course = modulestore().get_course(course_id)
return course.week_summary(week_num)
return course.highlights_for_week(week_num)
else:
raise CourseUpdateDoesNotExist()
{% load i18n %}
<p>
{# email client support for style sheets is pretty spotty, so we have to inline all of these styles #}
<a
{% if course_ids|length > 1 %}
href="{{ dashboard_url }}"
{% else %}
href="{{ course_url }}"
{% endif %}
style="
color: #ffffff;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #005686;
border-top: 12px solid #005686;
border-bottom: 12px solid #005686;
border-right: 50px solid #005686;
border-left: 50px solid #005686;
display: inline-block;
">
{# old email clients require the use of the font tag :( #}
<font color="#ffffff"><b>{{ course_cta_text }}</b></font>
</a>
</p>
{% load i18n %}
{% if show_upsell %}
<p>
{% blocktrans trimmed %}
Don't miss the opportunity to highlight your new knowledge and skills by earning a verified
certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
{% endblocktrans %}
</p>
<p>
<a href="{{ upsell_link }}"
style="
color: #1e8142;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #FFFFFF;
border: 3px solid #1e8142;
display: inline-block;
padding: 8px 65px;
">
<font color="#1e8142"><b>{% trans "Upgrade Now" %}</b></font>
</a>
</p>
{% endif %}
{% load i18n %}
{% if show_upsell %}
{% blocktrans trimmed %}
Don't miss the opportunity to highlight your new knowledge and skills by earning a verified
certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
Upgrade Now! <{{ upsell_link }}>
{% endblocktrans %}
{% endif %}
......@@ -20,31 +20,18 @@
<p>
{% blocktrans trimmed %}
Here is what you can look forward to learning this week:
<p>{{ week_summary }}</p>
{% endblocktrans %}
<ul>
{% for highlight in week_highlights %}
<li>{{ highlight }}</li>
{% endfor %}
</ul>
</p>
<p>
<!-- email client support for style sheets is pretty spotty, so we have to inline all of these styles -->
<a
href="{{ course_url }}"
style="
color: #ffffff;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #005686;
border-top: 10px solid #005686;
border-bottom: 10px solid #005686;
border-right: 16px solid #005686;
border-left: 16px solid #005686;
display: inline-block;
">
<!-- old email clients require the use of the font tag :( -->
<font color="#ffffff"><b>{% trans "Resume your course now" %}</b></font>
</a>
</p>
{% trans "Resume your course now" as course_cta_text %}
{% include "schedules/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
{% include "schedules/edx_ace/common/upsell_cta.html"%}
</td>
</tr>
</table>
......
......@@ -7,3 +7,5 @@ Here is what you can look forward to learning this week:
{{ week_summary }}
{% endblocktrans %}
{% include "schedules/edx_ace/common/upsell_cta.txt"%}
......@@ -35,56 +35,10 @@
{% endif %}
</p>
<p>
{# email client support for style sheets is pretty spotty, so we have to inline all of these styles #}
<a
{% if course_ids|length > 1 %}
href="{{ dashboard_url }}"
{% else %}
href="{{ course_url }}"
{% endif %}
style="
color: #ffffff;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #005686;
border-top: 12px solid #005686;
border-bottom: 12px solid #005686;
border-right: 50px solid #005686;
border-left: 50px solid #005686;
display: inline-block;
">
{# old email clients require the use of the font tag :( #}
<font color="#ffffff"><b>{% trans "Keep learning" %}</b></font>
</a>
</p>
{% trans "Keep learning" as course_cta_text %}
{% include "schedules/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
{% if show_upsell %}
<p>
{% blocktrans trimmed %}
Don't miss the opportunity to highlight your new knowledge and skills by earning a verified
certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
{% endblocktrans %}
</p>
<p>
<a href="{{ upsell_link }}"
style="
color: #1e8142;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #FFFFFF;
border: 3px solid #1e8142;
display: inline-block;
padding: 8px 65px;
">
<font color="#1e8142"><b>{% trans "Upgrade Now" %}</b></font>
</a>
</p>
{% endif %}
{% include "schedules/edx_ace/common/upsell_cta.html"%}
</td>
</tr>
</table>
......
......@@ -12,11 +12,5 @@
{% endblocktrans %}
{% trans "Keep learning" %} <{{course_url}}>
{% endif %}
{% if show_upsell %}
{% blocktrans trimmed %}
Don't miss the opportunity to highlight your new knowledge and skills by earning a verified
certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
Upgrade Now! <{{ upsell_link }}>
{% endblocktrans %}
{% endif %}
{% include "schedules/edx_ace/common/upsell_cta.txt"%}
......@@ -35,55 +35,10 @@
{% endif %}
</p>
<p>
{# email client support for style sheets is pretty spotty, so we have to inline all of these styles #}
<a
{% if course_ids|length > 1 %}
href="{{ dashboard_url }}"
{% else %}
href="{{ course_url }}"
{% endif %}
style="
color: #ffffff;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #005686;
border-top: 12px solid #005686;
border-bottom: 12px solid #005686;
border-right: 50px solid #005686;
border-left: 50px solid #005686;
display: inline-block;
">
{# old email clients require the use of the font tag :( #}
<font color="#ffffff"><b>{% trans "Start learning now" %}</b></font>
</a>
</p>
{% if show_upsell %}
<p>
{% blocktrans trimmed %}
Don't miss the opportunity to highlight your new knowledge and skills by earning a verified
certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
{% endblocktrans %}
</p>
<p>
<a href="{{ upsell_link }}"
style="
color: #1e8142;
text-decoration: none;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #FFFFFF;
border: 3px solid #1e8142;
display: inline-block;
padding: 8px 65px;
">
<font color="#1e8142"><b>{% trans "Upgrade Now" %}</b></font>
</a>
</p>
{% endif %}
{% trans "Start learning now" as course_cta_text %}
{% include "schedules/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
{% include "schedules/edx_ace/common/upsell_cta.html"%}
</td>
</tr>
</table>
......
......@@ -16,11 +16,4 @@
{% trans "Start learning now" %} <{{ course_url }}>
{% endif %}
{% if show_upsell %}
{% blocktrans trimmed %}
Don't miss the opportunity to highlight your new knowledge and skills by earning a verified
certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
Upgrade Now! <{{ upsell_link }}>
{% endblocktrans %}
{% endif %}
{% include "schedules/edx_ace/common/upsell_cta.txt"%}
......@@ -20,8 +20,6 @@
Upgrade by {{ user_schedule_upgrade_deadline_time }}.
{% endblocktrans %}
{% endif %}
{% blocktrans trimmed %}
{% endblocktrans %}
{% endblock %}
{% block content %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment