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):
to_addresses = [course_team_user.email]
from_address = settings.PUBLISHER_FROM_EMAIL
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 = {
'sender_role': PublisherUserRole.Publisher,
'recipient_name': course_team_user.get_full_name() or course_team_user.username,
'course_name': course_run.course.title,
'course_run_number': course_key.run,
'preview_link': course_run.preview_url,
'course_run': course_run,
'course_run_key': course_key,
'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 '',
'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
}
template = get_template(txt_template)
......
......@@ -426,6 +426,9 @@ class CourseRun(TimeStampedModel, ChangedByMixin):
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
def get_absolute_url(self):
return reverse('publisher:publisher_course_run_detail', kwargs={'pk': self.id})
class Seat(TimeStampedModel, ChangedByMixin):
""" Seat model. """
......
......@@ -18,8 +18,6 @@ from course_discovery.apps.publisher.tests import factories
@ddt.ddt
class CourseRunTests(TestCase):
""" Tests for the publisher `CourseRun` model. """
@classmethod
def setUpClass(cls):
super(CourseRunTests, cls).setUpClass()
......@@ -145,10 +143,13 @@ class CourseRunTests(TestCase):
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):
super(CourseTests, self).setUp()
self.org_extension_1 = factories.OrganizationExtensionFactory()
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -2821,6 +2821,8 @@ msgid ""
msgstr ""
#. 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.txt
#: templates/publisher/email/course/send_for_review.html
......@@ -2853,7 +2855,6 @@ msgstr ""
#: templates/publisher/email/course/seo_review.html
#: templates/publisher/email/course_run/mark_as_reviewed.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_course_run_editing.html
#: templates/publisher/email/course_run/send_for_review.html
......@@ -2998,20 +2999,40 @@ msgid ""
msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
#, 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 ""
"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."
"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 ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid "Preview the about page"
msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#: templates/publisher/email/course_run/preview_available.txt
msgid "Submit feedback in Publisher"
msgstr ""
#: templates/publisher/email/course_run/preview_available.html
#, python-format
msgid ""
"A preview is now available for the %(course_run_number)s course run of "
"%(course_name)s. View the course run in Publisher %(page_url)s to access the"
" preview for this About page and accept or decline the preview."
"Note: This email address is unable to receive replies. For questions or "
"comments, contact <a "
"href=\"mailto:%(contact_us_email)s\">%(contact_us_email)s</a>."
msgstr ""
#: templates/publisher/email/course_run/published.html
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -3335,6 +3335,8 @@ msgstr ""
"¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтα#"
#. 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.txt
#: templates/publisher/email/course/send_for_review.html
......@@ -3367,7 +3369,6 @@ msgstr "Thänks, Ⱡ'σяєм ιρѕυм #"
#: templates/publisher/email/course/seo_review.html
#: templates/publisher/email/course_run/mark_as_reviewed.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_course_run_editing.html
#: templates/publisher/email/course_run/send_for_review.html
......@@ -3579,39 +3580,57 @@ msgstr ""
" Ýöü çä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.txt
#, python-format
msgid ""
"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."
msgid "A preview is now available for the %(run)s run of %(title)s."
msgstr ""
"À prévïéw ïs nöw äväïläßlé för thé %(course_run_number)s çöürsé rün öf "
"%(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. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, "
"¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт "
"∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση "
"υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє "
"∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє νєłιт єѕѕє ¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα"
" ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт ¢υρι∂αтαт ηση ρяσι∂єηт, ѕυηт #"
"À prévïéw ïs nöw äväïläßlé för thé %(run)s rün öf %(title)s. Ⱡ'σяєм ιρѕυм "
"∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α#"
#: 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 ""
"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
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
msgid ""
"A preview is now available for the %(course_run_number)s course run of "
"%(course_name)s. View the course run in Publisher %(page_url)s to access the"
" preview for this About page and accept or decline the preview."
"Note: This email address is unable to receive replies. For questions or "
"comments, contact <a "
"href=\"mailto:%(contact_us_email)s\">%(contact_us_email)s</a>."
msgstr ""
"À prévïéw ïs nöw äväïläßlé för thé %(course_run_number)s çöürsé rün öf "
"%(course_name)s. Vïéw thé çöürsé rün ïn Püßlïshér %(page_url)s tö äççéss thé"
" prévïéw för thïs Àßöüt pägé änd äççépt ör déçlïné thé prévïéw. Ⱡ'σяєм ιρѕυм"
" ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ тємρσя "
"ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм, qυιѕ "
"ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ "
"¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє νєłιт єѕѕє "
"¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт ¢υρι∂αтαт "
"ηση ρяσι∂єηт, ѕυηт ιη ¢υłρα qυι#"
"Nöté: Thïs émäïl äddréss ïs ünäßlé tö réçéïvé réplïés. För qüéstïöns ör "
"çömménts, çöntäçt <a "
"href=\"mailto:%(contact_us_email)s\">%(contact_us_email)s</a>. Ⱡ'σяєм ιρѕυм "
"∂σłσя ѕιт αмєт#"
#: templates/publisher/email/course_run/published.html
#: templates/publisher/email/course_run/published.txt
......
{% extends "publisher/email/email_base.html" %}
{% load i18n %}
{% block body %}
<!-- Message Body -->
<p>
{% blocktrans trimmed %}
Dear {{ recipient_name }},
{% endblocktrans %}
</p>
<p>
{% blocktrans with link_start='<a href="' link_middle='">' link_end='</a>' trimmed %}
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.
{% 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 %}
</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>
{{ platform_name }} {{ sender_role }}
{% blocktrans trimmed %}
<p>Note: This email address is unable to receive replies. For questions or comments, contact {{ contact_us_email }}.</p>
{% endblocktrans %}
<!-- End Message Body -->
<p>
{% blocktrans trimmed %}
Note: This email address is unable to receive replies. For questions or comments, contact
<a href="mailto:{{ contact_us_email }}">{{ contact_us_email }}</a>.
{% endblocktrans %}
</p>
{% endblock body %}
......@@ -4,10 +4,21 @@
Dear {{ recipient_name }},
{% 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 %}
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 %}
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," %}
{{ 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