core: Format email templates.

This commit is contained in:
Teffen Ellis
2025-04-17 02:00:56 +02:00
parent 61bc89959b
commit 037ef3a2a0
6 changed files with 182 additions and 156 deletions

View File

@ -4,7 +4,7 @@
{% load humanize %}
{% block content %}
<tr>
<tr>
<td align="center">
<h1>
{% blocktrans with username=user.username %}
@ -12,8 +12,9 @@
{% endblocktrans %}
</h1>
</td>
</tr>
<tr>
</tr>
<tr>
<td align="center">
<table border="0">
<tr>
@ -23,6 +24,7 @@
{% endblocktrans %}
</td>
</tr>
<tr>
<td align="center" class="btn btn-primary">
{{ token }}
@ -30,15 +32,15 @@
</tr>
</table>
</td>
</tr>
</tr>
{% endblock %}
{% block sub_content %}
<tr>
<tr>
<td style="padding: 20px; font-size: 12px; color: #212124;" align="center">
{% blocktrans with expires=expires|timeuntil %}
If you did not request this code, please ignore this email. The code above is valid for {{ expires }}.
{% endblocktrans %}
</td>
</tr>
</tr>
{% endblock %}

View File

@ -4,14 +4,15 @@
{% load i18n %}
{% block content %}
<tr>
<tr>
<td align="center">
<h1>
{% trans 'Welcome!' %}
</h1>
</td>
</tr>
<tr>
</tr>
<tr>
<td align="center">
<table border="0">
<tr>
@ -19,23 +20,31 @@
{% trans "We're excited to have you get started. First, you need to confirm your account. Just press the button below."%}
</td>
</tr>
<tr>
<td align="center" class="btn btn-primary">
<a id="confirm" href="{{ url }}" rel="noopener noreferrer" target="_blank">{% trans 'Confirm Account' %}</a>
<a
id="confirm"
href="{{ url }}"
rel="noopener noreferrer"
target="_blank">
{% trans 'Confirm Account' %}
</a>
</td>
</tr>
</table>
</td>
</tr>
<td>
</tr>
<td>
{% endblock %}
{% block sub_content %}
<tr>
<tr>
<td style="padding: 20px; font-size: 12px; color: #212124;word-break: break-all; overflow-wrap: break-word;" align="center">
{% blocktrans with url=url %}
If that doesn't work, copy and paste the following link in your browser: {{ url }}
{% endblocktrans %}
</td>
</tr>
</tr>
{% endblock %}

View File

@ -1,5 +1,6 @@
{% load authentik_stages_email %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtm=l">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@ -99,11 +100,13 @@
<img src="{% block logo_url %}cid:logo.png{% endblock %}" border="0=" alt="authentik logo" class="flexibleImage logo">
</td>
</tr>
{% block content %}
{% endblock %}
</table>
</td>
</tr>
<tr>
<td>
<table border="0" style="margin-top: 10px;" width="100%">
@ -118,6 +121,7 @@
</table>
</td>
</tr>
<tr>
<td align="center">
Powered by <a rel="noopener noreferrer" target="_blank" href="https://goauthentik.io?utm_source=authentik&utm_medium=email">authentik</a>.

View File

@ -3,14 +3,15 @@
{% load i18n %}
{% block content %}
<tr>
<tr>
<td align="center">
<h1>
{{ title }}
</h1>
</td>
</tr>
<tr>
</tr>
<tr>
<td align="center">
<table border="0">
<tr>
@ -18,6 +19,7 @@
{{ body }}
</td>
</tr>
{% if key_value %}
<tr>
<td>
@ -36,17 +38,17 @@
{% endif %}
</table>
</td>
</tr>
</tr>
{% endblock %}
{% block sub_content %}
{% if source %}
<tr>
{% if source %}
<tr>
<td style="padding: 20px; font-size: 12px; color: #212124;" align="center">
{% blocktranslate with name=source.from %}
This email was sent from the notification transport <code>{{ name }}</code>.
{% endblocktranslate %}
</td>
</tr>
{% endif %}
</tr>
{% endif %}
{% endblock %}

View File

@ -4,7 +4,7 @@
{% load humanize %}
{% block content %}
<tr>
<tr>
<td align="center">
<h1>
{% blocktrans with username=user.username %}
@ -12,8 +12,9 @@
{% endblocktrans %}
</h1>
</td>
</tr>
<tr>
</tr>
<tr>
<td align="center">
<table border="0">
<tr>
@ -23,22 +24,29 @@
{% endblocktrans %}
</td>
</tr>
<tr>
<td align="center" class="btn btn-primary">
<a id="confirm" href="{{ url }}" rel="noopener noreferrer" target="_blank">{% trans 'Reset Password' %}</a>
<a
id="confirm"
href="{{ url }}"
rel="noopener noreferrer"
target="_blank">
{% trans 'Reset Password' %}
</a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
{% endblock %}
{% block sub_content %}
<tr>
<tr>
<td style="padding: 20px; font-size: 12px; color: #212124;" align="center">
{% blocktrans with expires=expires|naturaltime %}
If you did not request a password change, please ignore this email. The link above is valid for {{ expires }}.
{% endblocktrans %}
</td>
</tr>
</tr>
{% endblock %}

View File

@ -4,12 +4,13 @@
{% load i18n %}
{% block content %}
<tr>
<tr>
<td class="alert alert-brand">
{% trans 'authentik Test-Email' %}
</td>
</tr>
<tr>
</tr>
<tr>
<td class="content-wrap">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
@ -21,5 +22,5 @@
</tr>
</table>
</td>
</tr>
</tr>
{% endblock %}