Commit e7b35904 by Tyler Hallada

Add verified cert image to email template

Make image url in the task and pass to template
parent 9876f597
...@@ -6,6 +6,7 @@ from celery.task import task ...@@ -6,6 +6,7 @@ from celery.task import task
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db.models import F, Min 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 ...@@ -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 # This is used by the bulk email optout policy
'course_ids': course_id_strs, '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) yield (user, first_schedule.enrollment.course.language, template_context)
......
{% extends 'schedules/edx_ace/common/base_body.html' %} {% extends 'schedules/edx_ace/common/base_body.html' %}
{% load i18n %} {% load i18n %}
{% load static %}
{% block preview_text %} {% block preview_text %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
...@@ -29,26 +30,39 @@ ...@@ -29,26 +30,39 @@
{% endblocktrans %} {% endblocktrans %}
</p> </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> <p>
<!-- email client support for style sheets is pretty spotty, so we have to inline all of these styles --> <!-- email client support for style sheets is pretty spotty, so we have to inline all of these styles -->
<a <a
{% if course_ids|length > 1 %}
href="{{ dashboard_url }}"
{% else %}
href="{{ course_url }}" href="{{ course_url }}"
{% endif %} style="
style=" color: #ffffff;
color: #ffffff; text-decoration: none;
text-decoration: none; border-radius: 4px;
border-radius: 4px; -webkit-border-radius: 4px;
-webkit-border-radius: 4px; -moz-border-radius: 4px;
-moz-border-radius: 4px; background-color: #005686;
background-color: #005686; border-top: 10px solid #005686;
border-top: 10px solid #005686; border-bottom: 10px solid #005686;
border-bottom: 10px solid #005686; border-right: 16px solid #005686;
border-right: 16px solid #005686; border-left: 16px solid #005686;
border-left: 16px solid #005686; display: inline-block;
display: inline-block;
"> ">
<!-- old email clients require the use of the font tag :( --> <!-- old email clients require the use of the font tag :( -->
<font color="#ffffff"><b>{% trans "Upgrade now" %}</b></font> <font color="#ffffff"><b>{% trans "Upgrade now" %}</b></font>
......
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