Commit 998a5b87 by Clinton Blackburn Committed by Clinton Blackburn

Updated preview available email content

- Listing next steps for user to follow
- Links point to the correct locations
- Included note reminding users not to share the URL

EDUCATOR-815
parent 09c2468f
...@@ -437,21 +437,14 @@ def send_email_preview_page_is_available(course_run, site): ...@@ -437,21 +437,14 @@ def send_email_preview_page_is_available(course_run, site):
to_addresses = [course_team_user.email] to_addresses = [course_team_user.email]
from_address = settings.PUBLISHER_FROM_EMAIL from_address = settings.PUBLISHER_FROM_EMAIL
project_coordinator = course_run.course.project_coordinator project_coordinator = course_run.course.project_coordinator
page_path = reverse('publisher:publisher_course_run_detail', kwargs={'pk': course_run.id})
course_page_path = reverse('publisher:publisher_course_detail', kwargs={'pk': course_run.course.id})
context = { context = {
'sender_role': PublisherUserRole.Publisher, 'sender_role': PublisherUserRole.Publisher,
'recipient_name': course_team_user.get_full_name() or course_team_user.username, 'recipient_name': course_team_user.get_full_name() or course_team_user.username,
'course_name': course_run.course.title, 'course_run': course_run,
'course_run_number': course_key.run, 'course_run_key': course_key,
'preview_link': course_run.preview_url, 'course_run_publisher_url': 'https://{host}{path}'.format(
host=site.domain.strip('/'), path=course_run.get_absolute_url()),
'contact_us_email': project_coordinator.email if project_coordinator else '', 'contact_us_email': project_coordinator.email if project_coordinator else '',
'page_url': 'https://{host}{path}'.format(
host=site.domain.strip('/'), path=page_path
),
'course_page_url': 'https://{host}{path}'.format(
host=site.domain.strip('/'), path=course_page_path
),
'platform_name': settings.PLATFORM_NAME 'platform_name': settings.PLATFORM_NAME
} }
template = get_template(txt_template) template = get_template(txt_template)
......
...@@ -426,6 +426,9 @@ class CourseRun(TimeStampedModel, ChangedByMixin): ...@@ -426,6 +426,9 @@ class CourseRun(TimeStampedModel, ChangedByMixin):
seats = self.seats.filter(type__in=[Seat.AUDIT, Seat.VERIFIED, Seat.PROFESSIONAL, Seat.CREDIT]) seats = self.seats.filter(type__in=[Seat.AUDIT, Seat.VERIFIED, Seat.PROFESSIONAL, Seat.CREDIT])
return all([seat.is_valid_seat for seat in seats]) if seats else False return all([seat.is_valid_seat for seat in seats]) if seats else False
def get_absolute_url(self):
return reverse('publisher:publisher_course_run_detail', kwargs={'pk': self.id})
class Seat(TimeStampedModel, ChangedByMixin): class Seat(TimeStampedModel, ChangedByMixin):
""" Seat model. """ """ Seat model. """
......
...@@ -18,8 +18,6 @@ from course_discovery.apps.publisher.tests import factories ...@@ -18,8 +18,6 @@ from course_discovery.apps.publisher.tests import factories
@ddt.ddt @ddt.ddt
class CourseRunTests(TestCase): class CourseRunTests(TestCase):
""" Tests for the publisher `CourseRun` model. """
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super(CourseRunTests, cls).setUpClass() super(CourseRunTests, cls).setUpClass()
...@@ -145,10 +143,13 @@ class CourseRunTests(TestCase): ...@@ -145,10 +143,13 @@ class CourseRunTests(TestCase):
self.assertTrue(self.course_run.has_valid_seats) self.assertTrue(self.course_run.has_valid_seats)
def test_get_absolute_url(self):
course_run = factories.CourseRunFactory()
expected = reverse('publisher:publisher_course_run_detail', kwargs={'pk': course_run.id})
assert course_run.get_absolute_url() == expected
class CourseTests(TestCase):
""" Tests for the publisher `Course` model. """
class CourseTests(TestCase):
def setUp(self): def setUp(self):
super(CourseTests, self).setUp() super(CourseTests, self).setUp()
self.org_extension_1 = factories.OrganizationExtensionFactory() self.org_extension_1 = factories.OrganizationExtensionFactory()
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-11 17:00+0500\n" "POT-Creation-Date: 2017-09-11 17:05-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -2821,6 +2821,8 @@ msgid "" ...@@ -2821,6 +2821,8 @@ msgid ""
msgstr "" msgstr ""
#. Translators: It's closing of mail. #. Translators: It's closing of mail.
#. Translators: This is part of an email signature.
#. Translators: It's closing of mail.
#: templates/publisher/email/course/mark_as_reviewed.html #: templates/publisher/email/course/mark_as_reviewed.html
#: templates/publisher/email/course/mark_as_reviewed.txt #: templates/publisher/email/course/mark_as_reviewed.txt
#: templates/publisher/email/course/send_for_review.html #: templates/publisher/email/course/send_for_review.html
...@@ -2853,7 +2855,6 @@ msgstr "" ...@@ -2853,7 +2855,6 @@ msgstr ""
#: templates/publisher/email/course/seo_review.html #: templates/publisher/email/course/seo_review.html
#: templates/publisher/email/course_run/mark_as_reviewed.html #: templates/publisher/email/course_run/mark_as_reviewed.html
#: templates/publisher/email/course_run/preview_accepted.html #: templates/publisher/email/course_run/preview_accepted.html
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/published.html #: templates/publisher/email/course_run/published.html
#: templates/publisher/email/course_run/published_course_run_editing.html #: templates/publisher/email/course_run/published_course_run_editing.html
#: templates/publisher/email/course_run/send_for_review.html #: templates/publisher/email/course_run/send_for_review.html
...@@ -2998,20 +2999,40 @@ msgid "" ...@@ -2998,20 +2999,40 @@ msgid ""
msgstr "" msgstr ""
#: templates/publisher/email/course_run/preview_available.html #: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
#, python-format #, python-format
msgid "A preview is now available for the %(run)s run of %(title)s."
msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid "Follow these steps to move forward with publishing the course run."
msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid "" msgid ""
"A preview is now available for the %(course_run_number)s course run of " "Please do not share the preview URL publicly or use it in your own "
"%(course_name)s. %(link_start)s%(preview_link)s%(link_middle)s View the " "advertising. The finalized public URL will be available after the page is "
"course run in Publisher%(link_end)s to access the preview for this About " "fully published."
"page and accept or decline the preview." msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid "Preview the about page"
msgstr "" msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt #: templates/publisher/email/course_run/preview_available.txt
msgid "Submit feedback in Publisher"
msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#, python-format #, python-format
msgid "" msgid ""
"A preview is now available for the %(course_run_number)s course run of " "Note: This email address is unable to receive replies. For questions or "
"%(course_name)s. View the course run in Publisher %(page_url)s to access the" "comments, contact <a "
" preview for this About page and accept or decline the preview." "href=\"mailto:%(contact_us_email)s\">%(contact_us_email)s</a>."
msgstr "" msgstr ""
#: templates/publisher/email/course_run/published.html #: templates/publisher/email/course_run/published.html
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-11 17:00+0500\n" "POT-Creation-Date: 2017-09-11 17:05-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -3335,6 +3335,8 @@ msgstr "" ...@@ -3335,6 +3335,8 @@ msgstr ""
"¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтα#" "¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтα#"
#. Translators: It's closing of mail. #. Translators: It's closing of mail.
#. Translators: This is part of an email signature.
#. Translators: It's closing of mail.
#: templates/publisher/email/course/mark_as_reviewed.html #: templates/publisher/email/course/mark_as_reviewed.html
#: templates/publisher/email/course/mark_as_reviewed.txt #: templates/publisher/email/course/mark_as_reviewed.txt
#: templates/publisher/email/course/send_for_review.html #: templates/publisher/email/course/send_for_review.html
...@@ -3367,7 +3369,6 @@ msgstr "Thänks, Ⱡ'σяєм ιρѕυм #" ...@@ -3367,7 +3369,6 @@ msgstr "Thänks, Ⱡ'σяєм ιρѕυм #"
#: templates/publisher/email/course/seo_review.html #: templates/publisher/email/course/seo_review.html
#: templates/publisher/email/course_run/mark_as_reviewed.html #: templates/publisher/email/course_run/mark_as_reviewed.html
#: templates/publisher/email/course_run/preview_accepted.html #: templates/publisher/email/course_run/preview_accepted.html
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/published.html #: templates/publisher/email/course_run/published.html
#: templates/publisher/email/course_run/published_course_run_editing.html #: templates/publisher/email/course_run/published_course_run_editing.html
#: templates/publisher/email/course_run/send_for_review.html #: templates/publisher/email/course_run/send_for_review.html
...@@ -3579,39 +3580,57 @@ msgstr "" ...@@ -3579,39 +3580,57 @@ msgstr ""
" Ýöü çän nöw püßlïsh thïs Àßöüt pägé. Ⱡ'σяє#" " Ýöü çän nöw püßlïsh thïs Àßöüt pägé. Ⱡ'σяє#"
#: templates/publisher/email/course_run/preview_available.html #: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
#, python-format #, python-format
msgid "" msgid "A preview is now available for the %(run)s run of %(title)s."
"A preview is now available for the %(course_run_number)s course run of "
"%(course_name)s. %(link_start)s%(preview_link)s%(link_middle)s View the "
"course run in Publisher%(link_end)s to access the preview for this About "
"page and accept or decline the preview."
msgstr "" msgstr ""
"À prévïéw ïs nöw äväïläßlé för thé %(course_run_number)s çöürsé rün öf " "À prévïéw ïs nöw äväïläßlé för thé %(run)s rün öf %(title)s. Ⱡ'σяєм ιρѕυм "
"%(course_name)s. %(link_start)s%(preview_link)s%(link_middle)s Vïéw thé " "∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α#"
"çöürsé rün ïn Püßlïshér%(link_end)s tö äççéss thé prévïéw för thïs Àßöüt "
"pägé änd äççépt ör déçlïné thé prévïéw. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, " #: templates/publisher/email/course_run/preview_available.html
"¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт " #: templates/publisher/email/course_run/preview_available.txt
"∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση " msgid "Follow these steps to move forward with publishing the course run."
"υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє " msgstr ""
"∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє νєłιт єѕѕє ¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα" "Föllöw thésé stéps tö mövé förwärd wïth püßlïshïng thé çöürsé rün. Ⱡ'σяєм "
" ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт ¢υρι∂αтαт ηση ρяσι∂єηт, ѕυηт #" "ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя #"
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid ""
"Please do not share the preview URL publicly or use it in your own "
"advertising. The finalized public URL will be available after the page is "
"fully published."
msgstr ""
"Pléäsé dö nöt shäré thé prévïéw ÛRL püßlïçlý ör üsé ït ïn ýöür öwn "
"ädvértïsïng. Thé fïnälïzéd püßlïç ÛRL wïll ßé äväïläßlé äftér thé pägé ïs "
"füllý püßlïshéd. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, "
"ѕє∂ ∂σ єιυѕмσ∂ тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм "
"α∂ мιηιм νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ "
"єχ єα ¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє"
" νєłιт єѕѕє ¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт "
"¢υρι∂αтαт ηση ρяσι∂єηт, ѕυηт ιη ¢υłρα qυι σƒƒι¢ια ∂єѕєяυηт #"
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid "Preview the about page"
msgstr "Prévïéw thé äßöüt pägé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢#"
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt #: templates/publisher/email/course_run/preview_available.txt
msgid "Submit feedback in Publisher"
msgstr "Süßmït féédßäçk ïn Püßlïshér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢#"
#: templates/publisher/email/course_run/preview_available.html
#, python-format #, python-format
msgid "" msgid ""
"A preview is now available for the %(course_run_number)s course run of " "Note: This email address is unable to receive replies. For questions or "
"%(course_name)s. View the course run in Publisher %(page_url)s to access the" "comments, contact <a "
" preview for this About page and accept or decline the preview." "href=\"mailto:%(contact_us_email)s\">%(contact_us_email)s</a>."
msgstr "" msgstr ""
"À prévïéw ïs nöw äväïläßlé för thé %(course_run_number)s çöürsé rün öf " "Nöté: Thïs émäïl äddréss ïs ünäßlé tö réçéïvé réplïés. För qüéstïöns ör "
"%(course_name)s. Vïéw thé çöürsé rün ïn Püßlïshér %(page_url)s tö äççéss thé" "çömménts, çöntäçt <a "
" prévïéw för thïs Àßöüt pägé änd äççépt ör déçlïné thé prévïéw. Ⱡ'σяєм ιρѕυм" "href=\"mailto:%(contact_us_email)s\">%(contact_us_email)s</a>. Ⱡ'σяєм ιρѕυм "
" ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ тємρσя " "∂σłσя ѕιт αмєт#"
"ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм, qυιѕ "
"ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ "
"¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє νєłιт єѕѕє "
"¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт ¢υρι∂αтαт "
"ηση ρяσι∂єηт, ѕυηт ιη ¢υłρα qυι#"
#: templates/publisher/email/course_run/published.html #: templates/publisher/email/course_run/published.html
#: templates/publisher/email/course_run/published.txt #: templates/publisher/email/course_run/published.txt
......
{% extends "publisher/email/email_base.html" %} {% extends "publisher/email/email_base.html" %}
{% load i18n %} {% load i18n %}
{% block body %} {% block body %}
<!-- Message Body -->
<p> <p>
{% blocktrans trimmed %} {% blocktrans trimmed %}
Dear {{ recipient_name }}, Dear {{ recipient_name }},
{% endblocktrans %} {% endblocktrans %}
</p>
<p> <p>
{% blocktrans with link_start='<a href="' link_middle='">' link_end='</a>' trimmed %} {% blocktrans trimmed with run=course_run_key.run title=course_run.course.title %}
A preview is now available for the {{ course_run_number }} course run of {{ course_name }}. {{ link_start }}{{ preview_link }}{{ link_middle }} View the course run in Publisher{{ link_end }} to access the preview for this About page and accept or decline the preview. A preview is now available for the {{ run }} run of {{ title }}.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p>
{% trans "Follow these steps to move forward with publishing the course run." %}
</p>
<p>
<strong>
{% blocktrans trimmed %}
Please do not share the preview URL publicly or use it in your own advertising. The finalized
public URL will be available after the page is fully published.
{% endblocktrans %}
</strong>
</p>
<ol>
<li><a href="{{ course_run.preview_url }}">{% trans "Preview the about page" %}</a></li>
<li><a href="{{ course_run_publisher_url }}">{% trans "Submit feedback in Publisher" %}</a></li>
</ol>
{% comment %}Translators: It's closing of mail.{% endcomment %} {% comment %}Translators: This is part of an email signature.{% endcomment %}
{% trans "Thanks," %}<br> {% trans "Thanks," %}<br>
{{ platform_name }} {{ sender_role }} {{ platform_name }} {{ sender_role }}
<p>
{% blocktrans trimmed %} {% blocktrans trimmed %}
<p>Note: This email address is unable to receive replies. For questions or comments, contact {{ contact_us_email }}.</p> Note: This email address is unable to receive replies. For questions or comments, contact
{% endblocktrans %} <a href="mailto:{{ contact_us_email }}">{{ contact_us_email }}</a>.
{% endblocktrans %}
<!-- End Message Body --> </p>
{% endblock body %} {% endblock body %}
...@@ -4,10 +4,21 @@ ...@@ -4,10 +4,21 @@
Dear {{ recipient_name }}, Dear {{ recipient_name }},
{% endblocktrans %} {% endblocktrans %}
{% blocktrans trimmed with run=course_run_key.run title=course_run.course.title %}
A preview is now available for the {{ run }} run of {{ title }}.
{% endblocktrans %}
{% trans "Follow these steps to move forward with publishing the course run." %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
A preview is now available for the {{ course_run_number }} course run of {{ course_name }}. View the course run in Publisher {{ page_url }} to access the preview for this About page and accept or decline the preview. Please do not share the preview URL publicly or use it in your own advertising. The finalized
public URL will be available after the page is fully published.
{% endblocktrans %} {% endblocktrans %}
1. {% trans "Preview the about page" %} ({{ course_run.preview_url }})
2. {% trans "Submit feedback in Publisher" %} ({{ course_run_publisher_url }})
{% comment %}Translators: This is part of an email signature.{% endcomment %}
{% trans "Thanks," %} {% trans "Thanks," %}
{{ platform_name }} {{ sender_role }} {{ platform_name }} {{ sender_role }}
......
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