fix: restore watermark image in email templates
All checks were successful
CI / build (push) Successful in 2m18s
CI / docker (push) Successful in 1m10s

The previous commit incorrectly removed the watermark — only the
style extraction into <style> blocks was requested. Restores the
watermark <img>, {{watermarkUrl}} placeholder resolution in both
EmailConnectorService and PasswordResetNotificationService, and
the corresponding test assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-26 15:14:35 +02:00
parent f681784e7e
commit c55427c22b
8 changed files with 68 additions and 10 deletions

View File

@@ -45,6 +45,25 @@ class EmailTemplateLoadingTest {
}
}
@Test
void templatesContainWatermarkPlaceholder() throws IOException {
for (String path : TEMPLATE_FILES) {
String content = new ClassPathResource(path).getContentAsString(StandardCharsets.UTF_8);
assertTrue(content.contains("{{watermarkUrl}}"),
path + " must contain {{watermarkUrl}} placeholder");
}
}
@Test
void watermarkPlaceholderIsReplaced() throws IOException {
String content = new ClassPathResource("email-templates/register.html")
.getContentAsString(StandardCharsets.UTF_8);
String resolved = content.replace("{{watermarkUrl}}",
"https://example.com/platform/assets/email-watermark.png");
assertFalse(resolved.contains("{{watermarkUrl}}"));
assertTrue(resolved.contains("https://example.com/platform/assets/email-watermark.png"));
}
@Test
void templatesContainBrandElements() throws IOException {
for (String path : TEMPLATE_FILES) {