Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d3dcca2f
Commit
d3dcca2f
authored
Oct 25, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedules: DRY upsell and CTA in templates
parent
892c5af8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
115 deletions
+74
-115
openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py
+2
-0
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/common/return_to_course_cta.html
+27
-0
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/common/upsell_cta.html
+26
-0
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/common/upsell_cta.txt
+10
-0
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.html
+3
-49
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.txt
+1
-7
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.html
+4
-49
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.txt
+1
-8
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/upgradereminder/email/body.html
+0
-2
No files found.
openedx/core/djangoapps/schedules/management/commands/tests/test_send_recurring_nudge.py
View file @
d3dcca2f
...
@@ -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
()
...
...
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/common/return_to_course_cta.html
0 → 100644
View file @
d3dcca2f
{% 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>
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/common/upsell_cta.html
0 → 100644
View file @
d3dcca2f
{% 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 %}
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/common/upsell_cta.txt
0 → 100644
View file @
d3dcca2f
{% 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 %}
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.html
View file @
d3dcca2f
...
@@ -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>
...
...
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.txt
View file @
d3dcca2f
...
@@ -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 %}
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.html
View file @
d3dcca2f
...
@@ -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>
...
...
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.txt
View file @
d3dcca2f
...
@@ -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 %}
openedx/core/djangoapps/schedules/templates/schedules/edx_ace/upgradereminder/email/body.html
View file @
d3dcca2f
...
@@ -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 %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment