Schedules: DRY upsell and CTA in templates
This commit is contained in:
@@ -306,6 +306,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()
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{% 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>
|
||||
@@ -0,0 +1,26 @@
|
||||
{% 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 %}
|
||||
@@ -0,0 +1,10 @@
|
||||
{% 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 %}
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user