From 037ef3a2a09b25116d1b56bda7ffe441f2642a04 Mon Sep 17 00:00:00 2001 From: Teffen Ellis Date: Thu, 17 Apr 2025 02:00:56 +0200 Subject: [PATCH] core: Format email templates. --- .../templates/email/email_otp.html | 70 ++++++++------- .../templates/email/account_confirmation.html | 71 ++++++++------- .../stages/email/templates/email/base.html | 4 + .../templates/email/event_notification.html | 88 ++++++++++--------- .../email/templates/email/password_reset.html | 76 +++++++++------- .../stages/email/templates/email/setup.html | 29 +++--- 6 files changed, 182 insertions(+), 156 deletions(-) diff --git a/authentik/stages/authenticator_email/templates/email/email_otp.html b/authentik/stages/authenticator_email/templates/email/email_otp.html index 18688d145e..555dc00184 100644 --- a/authentik/stages/authenticator_email/templates/email/email_otp.html +++ b/authentik/stages/authenticator_email/templates/email/email_otp.html @@ -4,41 +4,43 @@ {% load humanize %} {% block content %} - - -

- {% blocktrans with username=user.username %} - Hi {{ username }}, - {% endblocktrans %} -

- - - - - - - - - - - -
- {% blocktrans %} - Email MFA code. - {% endblocktrans %} -
- {{ token }} -
- - + + +

+ {% blocktrans with username=user.username %} + Hi {{ username }}, + {% endblocktrans %} +

+ + + + + + + + + + + + + +
+ {% blocktrans %} + Email MFA code. + {% endblocktrans %} +
+ {{ token }} +
+ + {% endblock %} {% block sub_content %} - - - {% blocktrans with expires=expires|timeuntil %} - If you did not request this code, please ignore this email. The code above is valid for {{ expires }}. - {% endblocktrans %} - - + + + {% blocktrans with expires=expires|timeuntil %} + If you did not request this code, please ignore this email. The code above is valid for {{ expires }}. + {% endblocktrans %} + + {% endblock %} diff --git a/authentik/stages/email/templates/email/account_confirmation.html b/authentik/stages/email/templates/email/account_confirmation.html index 404bc4639a..a6ac1852b4 100644 --- a/authentik/stages/email/templates/email/account_confirmation.html +++ b/authentik/stages/email/templates/email/account_confirmation.html @@ -4,38 +4,47 @@ {% load i18n %} {% block content %} - - -

- {% trans 'Welcome!' %} -

- - - - - - - - - - - -
- {% trans "We're excited to have you get started. First, you need to confirm your account. Just press the button below."%} -
- {% trans 'Confirm Account' %} -
- - - + + +

+ {% trans 'Welcome!' %} +

+ + + + + + + + + + + + + +
+ {% trans "We're excited to have you get started. First, you need to confirm your account. Just press the button below."%} +
+ + {% trans 'Confirm Account' %} + +
+ + + + {% endblock %} {% block sub_content %} - - - {% blocktrans with url=url %} - If that doesn't work, copy and paste the following link in your browser: {{ url }} - {% endblocktrans %} - - + + + {% blocktrans with url=url %} + If that doesn't work, copy and paste the following link in your browser: {{ url }} + {% endblocktrans %} + + {% endblock %} diff --git a/authentik/stages/email/templates/email/base.html b/authentik/stages/email/templates/email/base.html index 08a60107a0..60c0e8e3d5 100644 --- a/authentik/stages/email/templates/email/base.html +++ b/authentik/stages/email/templates/email/base.html @@ -1,5 +1,6 @@ {% load authentik_stages_email %} + @@ -99,11 +100,13 @@ + {% block content %} {% endblock %} + @@ -118,6 +121,7 @@
+ Powered by authentik. diff --git a/authentik/stages/email/templates/email/event_notification.html b/authentik/stages/email/templates/email/event_notification.html index 7ca78fc64a..6327eb0b01 100644 --- a/authentik/stages/email/templates/email/event_notification.html +++ b/authentik/stages/email/templates/email/event_notification.html @@ -3,50 +3,52 @@ {% load i18n %} {% block content %} - - -

- {{ title }} -

- - - - - - - - - {% if key_value %} - - - - {% endif %} -
- {{ body }} -
- - - {% for key, value in key_value.items %} - - - - - {% endfor %} - -
{{ key }}{{ value }}
-
- - + + +

+ {{ title }} +

+ + + + + + + + + + + {% if key_value %} + + + + {% endif %} +
+ {{ body }} +
+ + + {% for key, value in key_value.items %} + + + + + {% endfor %} + +
{{ key }}{{ value }}
+
+ + {% endblock %} {% block sub_content %} -{% if source %} - - - {% blocktranslate with name=source.from %} - This email was sent from the notification transport {{ name }}. - {% endblocktranslate %} - - -{% endif %} + {% if source %} + + + {% blocktranslate with name=source.from %} + This email was sent from the notification transport {{ name }}. + {% endblocktranslate %} + + + {% endif %} {% endblock %} diff --git a/authentik/stages/email/templates/email/password_reset.html b/authentik/stages/email/templates/email/password_reset.html index 15a96991fb..576bf7e326 100644 --- a/authentik/stages/email/templates/email/password_reset.html +++ b/authentik/stages/email/templates/email/password_reset.html @@ -4,41 +4,49 @@ {% load humanize %} {% block content %} - - -

- {% blocktrans with username=user.username %} - Hi {{ username }}, - {% endblocktrans %} -

- - - - - - - - - - - -
- {% blocktrans %} - You recently requested to change your password for your authentik account. Use the button below to set a new password. - {% endblocktrans %} -
- {% trans 'Reset Password' %} -
- - + + +

+ {% blocktrans with username=user.username %} + Hi {{ username }}, + {% endblocktrans %} +

+ + + + + + + + + + + + + +
+ {% blocktrans %} + You recently requested to change your password for your authentik account. Use the button below to set a new password. + {% endblocktrans %} +
+ + {% trans 'Reset Password' %} + +
+ + {% endblock %} {% block sub_content %} - - - {% 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 %} - - + + + {% 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 %} + + {% endblock %} diff --git a/authentik/stages/email/templates/email/setup.html b/authentik/stages/email/templates/email/setup.html index 1efc080047..45228f57cc 100644 --- a/authentik/stages/email/templates/email/setup.html +++ b/authentik/stages/email/templates/email/setup.html @@ -4,22 +4,23 @@ {% load i18n %} {% block content %} - + - {% trans 'authentik Test-Email' %} + {% trans 'authentik Test-Email' %} - - + + + - - - - -
- {% blocktrans %} - This is a test email to inform you, that you've successfully configured authentik emails. - {% endblocktrans %} -
+ + + + +
+ {% blocktrans %} + This is a test email to inform you, that you've successfully configured authentik emails. + {% endblocktrans %} +
- + {% endblock %}