From 6e1807e51d977977939c2655d65c5933cd87fe5b Mon Sep 17 00:00:00 2001 From: Chasethechicken Date: Wed, 6 Mar 2024 15:32:52 +0100 Subject: [PATCH] stages/email: Disable autoescape for text templates (#8812) * Disable autoescape for text templates * Re-add trailing whitespace after seperator --- .../stages/email/templates/email/account_confirmation.txt | 3 ++- authentik/stages/email/templates/email/event_notification.txt | 3 ++- authentik/stages/email/templates/email/password_reset.txt | 3 ++- authentik/stages/email/templates/email/setup.txt | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/authentik/stages/email/templates/email/account_confirmation.txt b/authentik/stages/email/templates/email/account_confirmation.txt index 0a1fc70d1b..4f894e3835 100644 --- a/authentik/stages/email/templates/email/account_confirmation.txt +++ b/authentik/stages/email/templates/email/account_confirmation.txt @@ -1,4 +1,4 @@ -{% load i18n %}{% translate "Welcome!" %} +{% load i18n %}{% autoescape off %}{% translate "Welcome!" %} {% translate "We're excited to have you get started. First, you need to confirm your account. Just open the link below." %} @@ -6,3 +6,4 @@ -- Powered by goauthentik.io. +{% endautoescape %} diff --git a/authentik/stages/email/templates/email/event_notification.txt b/authentik/stages/email/templates/email/event_notification.txt index bd7d928969..3494e694e5 100644 --- a/authentik/stages/email/templates/email/event_notification.txt +++ b/authentik/stages/email/templates/email/event_notification.txt @@ -1,4 +1,4 @@ -{% load authentik_stages_email %}{% load i18n %}{% translate "Dear authentik user," %} +{% load authentik_stages_email %}{% load i18n %}{% autoescape off %}{% translate "Dear authentik user," %} {% translate "The following notification was created:" %} @@ -16,3 +16,4 @@ This email was sent from the notification transport {{ name }}. -- Powered by goauthentik.io. +{% endautoescape %} diff --git a/authentik/stages/email/templates/email/password_reset.txt b/authentik/stages/email/templates/email/password_reset.txt index 0c13ad2f89..7c4aa89b11 100644 --- a/authentik/stages/email/templates/email/password_reset.txt +++ b/authentik/stages/email/templates/email/password_reset.txt @@ -1,4 +1,4 @@ -{% load i18n %}{% load humanize %}{% blocktrans with username=user.username %}Hi {{ username }},{% endblocktrans %} +{% load i18n %}{% load humanize %}{% autoescape off %}{% blocktrans with username=user.username %}Hi {{ username }},{% endblocktrans %} {% blocktrans %} You recently requested to change your password for your authentik account. Use the link below to set a new password. @@ -10,3 +10,4 @@ If you did not request a password change, please ignore this Email. The link abo -- Powered by goauthentik.io. +{% endautoescape %} diff --git a/authentik/stages/email/templates/email/setup.txt b/authentik/stages/email/templates/email/setup.txt index 6d0eb0ce00..e6d9eaa427 100644 --- a/authentik/stages/email/templates/email/setup.txt +++ b/authentik/stages/email/templates/email/setup.txt @@ -1,7 +1,8 @@ -{% load i18n %}authentik Test-Email +{% load i18n %}{% autoescape off %}authentik Test-Email {% blocktrans %} This is a test email to inform you, that you've successfully configured authentik emails. {% endblocktrans %} -- Powered by goauthentik.io. +{% endautoescape %}