Add verified cert image to email template
Make image url in the task and pass to template
This commit is contained in:
@@ -6,6 +6,7 @@ from celery.task import task
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db.models import F, Min
|
||||
@@ -285,6 +286,7 @@ def _upgrade_reminder_schedules_for_bin(target_day, bin_num, org_list, exclude_o
|
||||
|
||||
# This is used by the bulk email optout policy
|
||||
'course_ids': course_id_strs,
|
||||
'cert_image': absolute_url(static('course_experience/images/verified-cert.png')),
|
||||
})
|
||||
|
||||
yield (user, first_schedule.enrollment.course.language, template_context)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% extends 'schedules/edx_ace/common/base_body.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block preview_text %}
|
||||
{% blocktrans trimmed %}
|
||||
@@ -29,26 +30,39 @@
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<a href="{{ course_url }}">
|
||||
<img
|
||||
src="{{ cert_image }}"
|
||||
alt="{% blocktrans %}Example print-out of a verified certificate{% endblocktrans %}"
|
||||
style="
|
||||
display: block;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
margin-top: 50px;
|
||||
margin-bottom: 50px;
|
||||
border-top: 1px solid lightgray;
|
||||
border-bottom: 3px solid lightgray;
|
||||
border-right: 3px solid lightgray;
|
||||
border-left: 1px solid lightgray;
|
||||
" />
|
||||
</a>
|
||||
|
||||
<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: 10px solid #005686;
|
||||
border-bottom: 10px solid #005686;
|
||||
border-right: 16px solid #005686;
|
||||
border-left: 16px solid #005686;
|
||||
display: inline-block;
|
||||
style="
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
background-color: #005686;
|
||||
border-top: 10px solid #005686;
|
||||
border-bottom: 10px solid #005686;
|
||||
border-right: 16px solid #005686;
|
||||
border-left: 16px solid #005686;
|
||||
display: inline-block;
|
||||
">
|
||||
<!-- old email clients require the use of the font tag :( -->
|
||||
<font color="#ffffff"><b>{% trans "Upgrade now" %}</b></font>
|
||||
|
||||
Reference in New Issue
Block a user