Commit d3dcca2f by Nimisha Asthagiri

Schedules: DRY upsell and CTA in templates

parent 892c5af8
...@@ -306,6 +306,8 @@ class TestSendRecurringNudge(FilteredQueryCountMixin, CacheIsolationTestCase): ...@@ -306,6 +306,8 @@ class TestSendRecurringNudge(FilteredQueryCountMixin, CacheIsolationTestCase):
for (_name, (_msg, email), _kwargs) in mock_channel.deliver.mock_calls: for (_name, (_msg, email), _kwargs) in mock_channel.deliver.mock_calls:
for template in attr.astuple(email): for template in attr.astuple(email):
self.assertNotIn("TEMPLATE WARNING", template) self.assertNotIn("TEMPLATE WARNING", template)
self.assertNotIn("{{", template)
self.assertNotIn("}}", template)
def test_user_in_course_with_verified_coursemode_receives_upsell(self): def test_user_in_course_with_verified_coursemode_receives_upsell(self):
user = UserFactory.create() user = UserFactory.create()
......
{% 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 %}
...@@ -35,56 +35,10 @@ ...@@ -35,56 +35,10 @@
{% endif %} {% endif %}
</p> </p>
<p> {% trans "Keep learning" as course_cta_text %}
{# email client support for style sheets is pretty spotty, so we have to inline all of these styles #} {% include "schedules/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
<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>
{% if show_upsell %} {% include "schedules/edx_ace/common/upsell_cta.html"%}
<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 %}
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -12,11 +12,5 @@ ...@@ -12,11 +12,5 @@
{% endblocktrans %} {% endblocktrans %}
{% trans "Keep learning" %} <{{course_url}}> {% trans "Keep learning" %} <{{course_url}}>
{% endif %} {% 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 }}> {% include "schedules/edx_ace/common/upsell_cta.txt"%}
{% endblocktrans %}
{% endif %}
...@@ -35,55 +35,10 @@ ...@@ -35,55 +35,10 @@
{% endif %} {% endif %}
</p> </p>
<p> {% trans "Start learning now" as course_cta_text %}
{# email client support for style sheets is pretty spotty, so we have to inline all of these styles #} {% include "schedules/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%}
<a
{% if course_ids|length > 1 %} {% include "schedules/edx_ace/common/upsell_cta.html"%}
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 %}
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -16,11 +16,4 @@ ...@@ -16,11 +16,4 @@
{% trans "Start learning now" %} <{{ course_url }}> {% trans "Start learning now" %} <{{ course_url }}>
{% endif %} {% endif %}
{% if show_upsell %} {% include "schedules/edx_ace/common/upsell_cta.txt"%}
{% 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,8 +20,6 @@ ...@@ -20,8 +20,6 @@
Upgrade by {{ user_schedule_upgrade_deadline_time }}. Upgrade by {{ user_schedule_upgrade_deadline_time }}.
{% endblocktrans %} {% endblocktrans %}
{% endif %} {% endif %}
{% blocktrans trimmed %}
{% endblocktrans %}
{% endblock %} {% endblock %}
{% block content %} {% 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