From 0cd6789e4118ceb60ca7eebbfe96a4bf69471714 Mon Sep 17 00:00:00 2001 From: Gutierrez Soto Jhosepmyr Orlando Date: Fri, 10 Jul 2026 11:36:37 -0500 Subject: [PATCH] feat(iam): redesign transactional email templates with 2026 best practices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces bare

/ string concatenation with a proper table-based, inline-CSS HTML layout (Outlook-safe), a hidden preheader, an accessible CTA button with a raw-link fallback, and a real multipart/alternative plain-text body generated from the same structured EmailContent — so HTML and plain text can't drift apart. Also fixes an HTML-injection gap: display/organization/project names were interpolated raw into the email body; they're now escaped via EmailTemplateRenderer before insertion. --- CHANGELOG.md | 24 +++ .../email/strategy/SmtpEmailAdapter.java | 101 ++++++++---- .../email/template/EmailContent.java | 28 ++++ .../email/template/EmailTemplateRenderer.java | 155 ++++++++++++++++++ .../email/strategy/SmtpEmailAdapterTest.java | 63 ++++++- 5 files changed, 341 insertions(+), 30 deletions(-) create mode 100644 src/main/java/com/kntro/reqsai/iam/infrastructure/email/template/EmailContent.java create mode 100644 src/main/java/com/kntro/reqsai/iam/infrastructure/email/template/EmailTemplateRenderer.java diff --git a/CHANGELOG.md b/CHANGELOG.md index f802ac83..d86926f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,30 @@ follows [Semantic Versioning](https://semver.org/). _Bounded-context implementation (iam, billing, workspace, discovery, gateway) in progress._ +### Changed (Transactional email templates — `feature/improve-email-html-templates`) + +- **Redesigned every transactional email** (verification, password reset, org invitation, project + invitation, project assignment) from bare unstyled `

`/`` tags into a proper, brand-consistent + HTML layout: table-based structure (renders correctly in Outlook's Word engine, unlike + flexbox/grid), all styling inlined per-element (webmail clients like Gmail strip `