Skip to content

Commit

Permalink
feat: add brand_color variable for the email templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bydawen committed Nov 16, 2023
1 parent c6b36a8 commit 6ab1153
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1>
{% blocktrans trimmed asvar assist_msg %}
If you need help, please use our web form at {start_anchor_web}{{ support_url }}{end_anchor} or email {start_anchor_email}{{ support_email }}{end_anchor}.
{% endblocktrans %}
{% interpolate_html assist_msg start_anchor_web='<a href="'|add:support_url|add:'">'|safe start_anchor_email='<a href="mailto:'|add:support_email|add:'">'|safe end_anchor='</a>'|safe %}
{% interpolate_html assist_msg start_anchor_web='<a style="color: '|add:brand_color|add:';" href="'|add:support_url|add:'">'|safe start_anchor_email='<a style="color: '|add:brand_color|add:';" href="mailto:'|add:support_email|add:'">'|safe end_anchor='</a>'|safe %}
<br />
</p>
</td>
Expand Down
2 changes: 2 additions & 0 deletions common/templates/student/edx_ace/emailchange/email/body.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with old_email='<a href="mailto:'|add:old_email|add:'" style="color: '|add:brand_color|add:';">'|add:old_email|add:'</a>'|safe new_email='<a href="mailto:'|add:new_email|add:'" style="color: '|add:brand_color|add:';">'|add:new_email|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -31,4 +32,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with old_email='<a href="mailto:'|add:old_email|add:'" style="color: '|add:brand_color|add:';">'|add:old_email|add:'</a>'|safe new_email='<a href="mailto:'|add:new_email|add:'" style="color: '|add:brand_color|add:';">'|add:new_email|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -30,4 +31,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with site_name='<a href="'|add:site_name|add:'" style="color: '|add:brand_color|add:';">'|safe|add:site_name|add:'</a>'|safe email_address='<a href="mailto:'|add:email_address|add:'" style="color: '|add:brand_color|add:';">'|safe|add:email_address|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -67,4 +68,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with site_name='<a href="'|add:site_name|add:'" style="color: '|add:brand_color|add:';">'|safe|add:site_name|add:'</a>'|safe email_address='<a href="mailto:'|add:email_address|add:'" style="color: '|add:brand_color|add:';">'|safe|add:email_address|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -81,4 +82,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with site_name='<a href="'|add:site_name|add:'" style="color: '|add:brand_color|add:';">'|safe|add:site_name|add:'</a>'|safe email_address='<a href="mailto:'|add:email_address|add:'" style="color: '|add:brand_color|add:';">'|safe|add:email_address|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -30,4 +31,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with site_name='<a href="'|add:site_name|add:'" style="color: '|add:brand_color|add:';">'|safe|add:site_name|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -39,4 +40,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with site_name='<a href="'|add:site_name|add:'" style="color: '|add:brand_color|add:';">'|safe|add:site_name|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -37,4 +38,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with site_name='<a href="'|add:site_name|add:'" style="color: '|add:brand_color|add:';">'|safe|add:site_name|add:'</a>'|safe email_address='<a href="mailto:'|add:email_address|add:'" style="color: '|add:brand_color|add:';">'|safe|add:email_address|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -44,4 +45,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% with dashboard_link='<a href="'|add:dashboard_link|add:'" style="color: '|add:brand_color|add:';">'|add:dashboard_link|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -39,4 +40,5 @@ <h1>
</td>
</tr>
</table>
{% endwith %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

{% google_analytics_tracking_pixel %}

{% with brand_color="#005686" logo_max_height="65px" %}
<div bgcolor="#f5f5f5" lang="{{ LANGUAGE_CODE|default:"en" }}" dir="{{ LANGUAGE_BIDI|yesno:"rtl,ltr" }}" style="
margin: 0;
padding: 0;
Expand Down Expand Up @@ -79,7 +80,7 @@
<tr>
<td align="left" valign="top">
<a href="{% with_link_tracking homepage_url %}">
<img src="{{ logo_url }}" style="max-height: 65px;" height="auto" alt="{% filter force_escape %}{% blocktrans %}Go to {{ platform_name }} Home Page{% endblocktrans %}{% endfilter %}"/></a>
<img src="{{ logo_url }}" style="max-height: {{ logo_max_height }};" height="auto" alt="{% filter force_escape %}{% blocktrans %}Go to {{ platform_name }} Home Page{% endblocktrans %}{% endfilter %}"/></a>
</td>
</tr>
</table>
Expand Down Expand Up @@ -218,8 +219,8 @@
{% get_action_links channel omit_unsubscribe_link=omit_unsubscribe_link as action_links %}
{% for action_link_url, action_link_text in action_links %}
<p>
<a href="{{ action_link_url }}" style="color: #005686">
<font color="#005686"><b>{{ action_link_text }}</b></font>
<a href="{{ action_link_url }}" style="color: {{ brand_color }};">
<font color="{{ brand_color }}"><b>{{ action_link_text }}</b></font>
</a>
</p>
{% endfor %}
Expand Down Expand Up @@ -253,6 +254,7 @@
<![endif]-->

</div>
{% endwith %}

{# Debug info that is not user-visible #}
<span id="ace-message-id" style="display:none;">{{ message.log_id }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color: #005686;
border-top: 12px solid #005686;
border-bottom: 12px solid #005686;
border-right: 50px solid #005686;
border-left: 50px solid #005686;
background-color: {{ brand_color }};
border-top: 12px solid {{ brand_color }};
border-bottom: 12px solid {{ brand_color }};
border-right: 50px solid {{ brand_color }};
border-left: 50px solid {{ brand_color }};
display: inline-block;
">
{# old email clients require the use of the font tag :( #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ <h1>{% trans "Upgrade now" as tmsg %}{{ tmsg | force_escape }}</h1>
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;
background-color: {{ brand_color }};
border-top: 10px solid {{ brand_color }};
border-bottom: 10px solid {{ brand_color }};
border-right: 16px solid {{ brand_color }};
border-left: 16px solid {{ brand_color }};
display: inline-block;
">
{# old email clients require the use of the font tag :( #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load i18n %}

{% block content %}
{% with contact_email='<a href="'|add:contact_email|add:'" style="color: '|add:brand_color|add:';">'|safe|add:contact_email|add:'</a>'|safe %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
Expand Down Expand Up @@ -44,4 +45,5 @@
</td>
</tr>
</table>
{% endwith %}
{% endblock %}

0 comments on commit 6ab1153

Please sign in to comment.