From 3379dd6258d0b5f8f0e1cf0a6dca3c14c0a4eb56 Mon Sep 17 00:00:00 2001 From: int-y1 Date: Mon, 31 Oct 2022 05:01:46 -0400 Subject: [PATCH] Modernize activation email --- templates/registration/activation_email.html | 40 ++++++++++--------- templates/registration/activation_email.txt | 14 ++++--- .../registration/activation_email_subject.txt | 2 +- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/templates/registration/activation_email.html b/templates/registration/activation_email.html index a90b9fc0e1..e49673f0e3 100644 --- a/templates/registration/activation_email.html +++ b/templates/registration/activation_email.html @@ -1,23 +1,27 @@ -Thanks for registering on the {{ site.name }}! We're glad to have you. +
+{{ SITE_NAME }} +
+ +
+{{ _("Thanks for registering on the %(site_name)s! We're glad to have you.", site_name=SITE_NAME) }}

-The last step is activating your account. Please activate your {{ SITE_NAME }} account in the next {{ expiration_days }} days. +{% trans trimmed count=expiration_days, site_name=SITE_NAME %} +The last step is activating your account. Please activate your {{ site_name }} account in the next {{ count }} day. +{% pluralize %} +The last step is activating your account. Please activate your {{ site_name }} account in the next {{ count }} days. +{% endtrans %}

-Please click on the following link to activate your account: -

- http://{{ site.domain }}/accounts/activate/{{ activation_key }} -

- -Alternatively, you can reply to this message to activate your account. -Your reply must keep the following text intact for this to work: - -
-{{ activation_key }}
-
- -{% if SITE_ADMIN_EMAIL %} -See you soon! +{{ _('Please click on the following link to activate your account:') }}
-If you have problems activating your account, feel free to send us an email at {{ SITE_ADMIN_EMAIL }}. +{{ request.scheme }}://{{ site.domain }}/accounts/activate/{{ activation_key }}/ +

+{{ _('Alternatively, you can reply to this message to activate your account. Your reply must keep the following text intact for this to work:') }} +

{{ activation_key }}

+{% if SITE_ADMIN_EMAIL %} +{% with link='%(email)s'|safe|format(email=SITE_ADMIN_EMAIL) %} +{{ _('See you soon! If you have problems activating your account, feel free to send us an email at %(email)s.', email=link) }} +{% endwith %} {% else %} -See you soon! +{{ _('See you soon!') }} {% endif %} +
diff --git a/templates/registration/activation_email.txt b/templates/registration/activation_email.txt index c13dc6e8dd..f4198f6593 100644 --- a/templates/registration/activation_email.txt +++ b/templates/registration/activation_email.txt @@ -1,9 +1,13 @@ -Please activate your {{ site.name }} account in {{ expiration_days }} days. +{% trans trimmed count=expiration_days, site_name=site.name %} +Please activate your {{ site_name }} account in the next {{ count }} day. +{% pluralize %} +Please activate your {{ site_name }} account in the next {{ count }} days. +{% endtrans %} -Please click on the following link to activate your account: - http://{{ site.domain }}/accounts/activate/{{ activation_key }}/ -Alternatively, you can reply to this message to activate your account. -Your reply must keep the following text intact for this to work: +{{ _('Please click on the following link to activate your account:') }} + {{ request.scheme }}://{{ site.domain }}/accounts/activate/{{ activation_key }}/ + +{{ _('Alternatively, you can reply to this message to activate your account. Your reply must keep the following text intact for this to work:') }} {{ activation_key }} diff --git a/templates/registration/activation_email_subject.txt b/templates/registration/activation_email_subject.txt index b0888c80a3..13f6071073 100644 --- a/templates/registration/activation_email_subject.txt +++ b/templates/registration/activation_email_subject.txt @@ -1 +1 @@ -Activate your {{ SITE_NAME }} account \ No newline at end of file +{{ _('Activate your %(site_name)s account', site_name=SITE_NAME) }}