From 238705495ed51ce4aac7d08acd1cfb1622bb7ecc Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 4 Jul 2026 14:51:34 +0200 Subject: [PATCH] Add shared HTML layout for transactional emails confirmation_email.html.twig and reset_password/email.html.twig were plain unstyled HTML with no shared structure. Extract a table-based layout (templates/emails/layout.html.twig) with header/logo, content block, and footer, so future transactional emails can extend it instead of starting from scratch. Co-Authored-By: Claude Sonnet 5 --- templates/emails/layout.html.twig | 33 +++++++++++++++ .../registration/confirmation_email.html.twig | 42 ++++++++++++++----- templates/tech/reset_password/email.html.twig | 32 +++++++++++--- 3 files changed, 92 insertions(+), 15 deletions(-) create mode 100644 templates/emails/layout.html.twig diff --git a/templates/emails/layout.html.twig b/templates/emails/layout.html.twig new file mode 100644 index 0000000..4f4cb32 --- /dev/null +++ b/templates/emails/layout.html.twig @@ -0,0 +1,33 @@ + + + + + + {% block title %}{{ 'site.name'|trans }}{% endblock %} + + + + + + +
+ + + + + + + + + + +
+ {{ 'site.name'|trans }} +
+ {% block content %}{% endblock %} +
+ © {{ "now"|date("Y") }} {{ 'site.name'|trans }} +
+
+ + diff --git a/templates/tech/registration/confirmation_email.html.twig b/templates/tech/registration/confirmation_email.html.twig index b256fa1..ae51489 100644 --- a/templates/tech/registration/confirmation_email.html.twig +++ b/templates/tech/registration/confirmation_email.html.twig @@ -1,12 +1,34 @@ -

Hi! Please confirm your email!

+{% extends 'emails/layout.html.twig' %} -

- Please confirm your email address by clicking the following link:

- Confirm my Email. - This link will expire in {{ expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle') }}. - If the link has expired or doesn't work, you can request a new one. -

+{% block title %}Confirm your email{% endblock %} -

- Cheers! -

+{% block content %} +

Hi! Please confirm your email

+ +

+ Thanks for signing up. Please confirm your email address by clicking the button below. + This link will expire in {{ expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle') }}. +

+ + + + + +
+ + Confirm my email + +
+ +

+ If the button doesn't work, copy and paste this link into your browser:
+ {{ signedUrl }} +

+ +

+ If the link has expired or doesn't work, you can + request a new one. +

+ +

Cheers!

+{% endblock %} diff --git a/templates/tech/reset_password/email.html.twig b/templates/tech/reset_password/email.html.twig index 824a218..c6b9b27 100644 --- a/templates/tech/reset_password/email.html.twig +++ b/templates/tech/reset_password/email.html.twig @@ -1,9 +1,31 @@ -

Hi!

+{% extends 'emails/layout.html.twig' %} -

To reset your password, please visit the following link

+{% block title %}Reset your password{% endblock %} -{{ url('app_reset_password', {token: resetToken.token}) }} +{% block content %} +

Hi!

-

This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}.

+

+ We received a request to reset your password. Click the button below to choose a new one. + This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}. +

-

Cheers!

+ + + + +
+ + Reset my password + +
+ +

+ If the button doesn't work, copy and paste this link into your browser:
+ {{ url('app_reset_password', {token: resetToken.token}) }} +

+ +

If you didn't request a password reset, you can safely ignore this email.

+ +

Cheers!

+{% endblock %}