Skip to content

WPB-19804 Email template validation#4699

Merged
battermann merged 24 commits intodevelopfrom
WPB-9935-html-injection-issue-2
Jan 14, 2026
Merged

WPB-19804 Email template validation#4699
battermann merged 24 commits intodevelopfrom
WPB-9935-html-injection-issue-2

Conversation

@battermann
Copy link
Contributor

@battermann battermann commented Aug 1, 2025

https://wearezeta.atlassian.net/browse/WPB-19804

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 1, 2025
@battermann battermann changed the title WPB-9935 Email template validation WPB-19804 Email template validation Aug 28, 2025
@battermann battermann force-pushed the WPB-9935-html-injection-issue-2 branch 2 times, most recently from f6611d6 to 316a8a5 Compare January 8, 2026 16:38
@battermann battermann force-pushed the WPB-9935-html-injection-issue-2 branch from 316a8a5 to c012d28 Compare January 9, 2026 09:39
@battermann battermann requested a review from Copilot January 12, 2026 10:02
@battermann battermann marked this pull request as ready for review January 12, 2026 10:02
@battermann battermann requested review from a team as code owners January 12, 2026 10:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive validation for email templates used in team and user communications, while refactoring the email rendering system to make it more testable and removing unused SMS/call templates.

Changes:

  • Added integration tests to validate all email templates render correctly without variable replacement errors
  • Refactored email rendering to use a testable polysemy-based approach with error tracking
  • Removed deprecated SMS and call templates across all locales
  • Updated URLs in configuration files to use new, more user-friendly formats

Reviewed changes

Copilot reviewed 153 out of 153 changed files in this pull request and generated no comments.

Show a summary per file
File Description
services/brig/test/integration/API/Template.hs New test module validating email template rendering for teams and users
libs/wire-subsystems/src/Wire/EmailSubsystem/Interpreter.hs Refactored to use polysemy Output effect for tracking unreplaced variables
libs/wire-subsystems/src/Wire/EmailSubsystem/Template.hs Added new rendering functions with error tracking capabilities
libs/wire-subsystems/src/Wire/EmailSubsystem/Templates/*.hs Split template definitions into separate User and Team modules
services/brig/src/Brig/Template.hs Added genTemplateBrandingMap for Map-based branding replacement
services/brig/brig.integration.yaml Updated URLs to use cleaner, more user-friendly formats
services/brig/src/Brig/Team/Email.hs Deleted - functionality moved to EmailSubsystem
libs/wire-subsystems/templates//user/sms/ Removed SMS templates across all locales
libs/wire-subsystems/templates//user/call/ Removed call templates across all locales
libs/wire-subsystems/templates//team/email/new-creator-welcome Removed creator welcome templates
Comments suppressed due to low confidence (2)

services/brig/test/integration/API/Template.hs:1

  • The hardcoded URL in the test assertion should match the configuration in brig.integration.yaml. Consider extracting the base URL and path pattern to avoid inconsistencies between test expectations and actual configuration.
    services/brig/test/integration/API/Template.hs:1
  • Similar to the previous comment, this hardcoded URL should align with the configuration. Consider using a shared constant or configuration value to ensure consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@battermann battermann merged commit c894071 into develop Jan 14, 2026
11 checks passed
@battermann battermann deleted the WPB-9935-html-injection-issue-2 branch January 14, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants