Adds email template layout and formatting

This commit is contained in:
Mouse Reeve
2021-03-21 11:43:14 -07:00
parent 33b5639af0
commit d8a20175b6
15 changed files with 152 additions and 20 deletions

View File

@ -0,0 +1,26 @@
{% load i18n %}
<div style="font-family: BlinkMacSystemFont,-apple-system,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Fira Sans','Droid Sans','Helvetica Neue',Helvetica,Arial,sans-serif; border-radius: 6px; background-color: #efefef; max-width: 632px;">
<div style="padding: 1rem; overflow: auto;">
<div style="float: left; margin-right: 1rem;">
<a style="color: #3273dc;" href="https://{{ domain }}" style="text-decoration: none;"><img src="https://{{ domain }}/{{ logo }}" alt="logo"></a>
</div>
<div>
<a style="color: black; text-decoration: none" href="https://{{ domain }}" style="text-decoration: none;"><strong>{{ site_name }}</strong><br>
{{ domain }}</a>
</div>
</div>
<div style="padding: 1rem; background-color: white;">
<p>
{% if user %}{{ user }},{% else %}{% trans "Hi there," %}{% endif %}
</p>
{% block content %}{% endblock %}
</div>
<div style="padding: 1rem; font-size: 0.8rem;">
<p style="margin: 0; color: #333;">{% blocktrans %}BookWyrm hosted on <a style="color: #3273dc;" href="https://{{ domain }}">{{ site_name }}</a>{% endblocktrans %}</p>
{% if user %}
<p style="margin: 0; color: #333;"><a style="color: #3273dc;" href="https://{{ domain }}{% url 'prefs-profile' %}">{% trans "Email preference" %}</a></p>
{% endif %}
</div>
</div>

View File

@ -1,2 +1,17 @@
{% extends 'email/html_layout.html' %}
{% load i18n %}
<a href="{{ invite_link }}">{% blocktrans %}Join {{ site_name }}{% endblocktrans %}</a>
{% block content %}
<p>
{% blocktrans %}You're invited to join {{ site_name }}!{% endblocktrans %}
</p>
{% trans "Join Now" as text %}
{% include 'email/snippets/action.html' with path=invite_link text=text %}
<p>
{% url 'code-of-conduct' as coc_path %}
{% url 'about' as about_path %}
{% blocktrans %}Learn more <a href="https://{{ domain }}{{ about_path }}">about this instance</a>.{% endblocktrans %}
</p>
{% endblock %}

View File

@ -1,2 +1,2 @@
{% load i18n %}
{% blocktrans %}You're invited! Join {{ site_name }}{% endblocktrans %}
{% blocktrans %}You're invited to join {{ site_name }}!{% endblocktrans %}

View File

@ -1,2 +1,10 @@
{% extends 'email/text_layout.html' %}
{% load i18n %}
{% blocktrans %}Join {{ site_name }}: {{ invite_link }}{% endblocktrans %}
{% block content %}
{% blocktrans %}You're invited to join {{ site_name }}! Click the link below to create an account.{% endblocktrans %}
{{ invite_link }}
{% trans "Learn more about this instance:" %} https://{{ domain }}{% url 'about' %}
{% endblock %}

View File

@ -1,2 +1,15 @@
{% extends 'email/html_layout.html' %}
{% load i18n %}
{% blocktrans %}Your password reset link is: {{ reset_link }}{% endblocktrans %}
{% block content %}
<p>
{% blocktrans %}You requested to reset your {{ site_name }} password. Click the link below to set a new password and log in to your account.{% endblocktrans %}
</p>
{% trans "Reset Password" as text %}
{% include 'email/snippets/action.html' with path=reset_link text=text %}
<p>
{% trans "If you didn't request to reset your password, you can ignore this email." %}
</p>
{% endblock %}

View File

@ -1,2 +1,2 @@
{% load i18n %}
{% blocktrans %}Reset your password on {{ site_name }}{% endblocktrans %}
{% blocktrans %}Reset your {{ site_name }} password{% endblocktrans %}

View File

@ -1,2 +1,9 @@
{% extends 'email/text_layout.html' %}
{% load i18n %}
{% blocktrans %}Your password reset link is: {{ reset_link }}{% endblocktrans %}
{% block content %}
{% blocktrans %}You requested to reset your {{ site_name }} password. Click the link below to set a new password and log in to your account.{% endblocktrans %}
{{ reset_link }}
{% trans "If you didn't request to reset your password, you can ignore this email." %}
{% endblock %}

View File

@ -0,0 +1,19 @@
<html>
<body>
<div>
<strong>Subject:</strong> {% include subject_path %}
</div>
<hr>
<strong>Html email:</strong>
<div style="border: 1px solid #c0c0c0; margin: 2em; padding: 1em;">
{% include html_content_path %}
</div>
<hr>
<strong>Text email:</strong>
<div style="border: 1px solid #c0c0c0; margin: 2em; padding: 1em; white-space: pre;">
{% include text_content_path %}
</div>
</body>
</html>

View File

@ -0,0 +1,5 @@
<p style="text-align: center; margin: 2rem;">
<a href="{{ path }}" style="background-color: #3273dc; color: #fff; border-radius: 4px; padding: 0.5rem 1rem; text-decoration: none;">
{{ text }}
</a>
</p>

View File

@ -0,0 +1,3 @@
{% load i18n %}
{% if user %}{{ user.display_name }},{% else %}{% trans "Hi there," %}{% endif %}
{% block content %}{% endblock %}