Skip to content

Commit

Permalink
Wrap channel name in <a> tag & hyperlink between brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
vkWeb committed Oct 31, 2022
1 parent 15d2f7e commit c1fd3f2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
{% load i18n %}
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
{% autoescape off %}
<p>{% blocktrans with name=user.first_name %}Hello {{ name }},{% endblocktrans %}</p>

<p><a href="{{ domain }}{% url 'channel' channel_id=channel.pk %}" target="_blank">{% blocktrans with channel_name=channel.name %}{{ channel_name }}{% endblocktrans %}</a> ({{ domain }}{% url 'channel' channel_id=channel.pk %}) {% translate "has finished publishing! Here is the channel token (for importing it into Kolibri):" %}</p>

<p>
{% blocktrans with channel_token=token %}Token: {{ channel_token }}{% endblocktrans %}
<br>
{% blocktrans with channel_id=channel.pk %}ID (for Kolibri version 0.6.0 and below): {{ channel_id }}{% endblocktrans %}
</p>

<p>{% blocktrans with notes=notes %}Version notes: {{ notes }}{% endblocktrans %}</p>

<p>
{% translate "Thanks for using Kolibri Studio!" %}
<br>
{% translate "The Learning Equality Team" %}
</p>

<p>{% translate "You are receiving this email because you are subscribed to this channel." %}</p>
{% endautoescape %}
</body>
</html>

This file was deleted.

8 changes: 4 additions & 4 deletions contentcuration/contentcuration/utils/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ def send_emails(channel, user_id, version_notes=''):

if user_id:
user = ccmodels.User.objects.get(pk=user_id)
message = render_to_string('registration/channel_published_email.txt',
message = render_to_string('registration/channel_published_email.html',
{'channel': channel, 'user': user, 'token': token, 'notes': version_notes, 'domain': domain})
user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL, )
user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL, html_message=message)
else:
# Email all users about updates to channel
for user in itertools.chain(channel.editors.all(), channel.viewers.all()):
message = render_to_string('registration/channel_published_email.txt',
message = render_to_string('registration/channel_published_email.html',
{'channel': channel, 'user': user, 'token': token, 'notes': version_notes, 'domain': domain})
user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL, )
user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL, html_message=message)


def create_content_database(channel, force, user_id, force_exercises, progress_tracker=None):
Expand Down

0 comments on commit c1fd3f2

Please sign in to comment.