Skip to content

Commit

Permalink
Set a background color for emails
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Apr 23, 2024
1 parent b908a8f commit 0f24c2b
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 13 deletions.
22 changes: 9 additions & 13 deletions templates/debug/emails.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,18 @@ <h1>Email Templates</h1>

{% for email in emails %}

<hr>
<hr>

<p>
<b>Subject:</b> {{ email.subject }}
</p>
<h2 class="fs-4 text-center">
{{ email.subject }}
</h2>

<p>
<b>Body:</b>

<br>

{{ email.body|safe }}
</p>
<div style="background-color: #dc3545;">
{{ email.body|safe }}
</div>

{% endfor %}

<hr>
<hr>

{% endblock %}
{% endblock main %}
6 changes: 6 additions & 0 deletions templates/emails/activity.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% extends "emails/base.html" %}

{% block content %}

<p style="font-size: 14pt;">
Hello {{ name }},
</p>
Expand Down Expand Up @@ -30,3 +34,5 @@
</p>

{% include "emails/_unsubscribe.html" %}

{% endblock content%}
18 changes: 18 additions & 0 deletions templates/emails/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body { background-color: white !important; }
</style>
</head>
<body style="background-color: white; margin: 0; padding: 0;">
<table role="presentation" width="100%" style="background-color: white;" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background-color: white;">
{% block content %}
{% endblock content %}
</td>
</tr>
</table>
</body>
</html>
6 changes: 6 additions & 0 deletions templates/emails/invite.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% extends "emails/base.html" %}

{% block content %}

<p style="font-size: 14pt;">
Hello {{ name }},
</p>
Expand All @@ -12,3 +16,5 @@
{% if complete %}join them{% else %}get started{% endif %}:
<a href="{{ url }}{{ query_string }}">{{ url }}</a>
</p>

{% endblock content %}
6 changes: 6 additions & 0 deletions templates/emails/login.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% extends "emails/base.html" %}

{% block content %}

<p style="font-size: 14pt;">
Hello {{ name }},
</p>
Expand All @@ -15,3 +19,5 @@
{% endif %}
<a href="{{ url }}{{ query_string }}">{{ url }}</a>
</p>

{% endblock content %}
6 changes: 6 additions & 0 deletions templates/emails/voted.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% extends "emails/base.html" %}

{% block content %}

<p style="font-size: 14pt;">
Hello {{ name }},
</p>
Expand All @@ -14,3 +18,5 @@
</p>

{% include "emails/_unsubscribe.html" %}

{% endblock content %}

0 comments on commit 0f24c2b

Please sign in to comment.