fix: move email styles to <style> block and remove watermark image
Extracts repeated inline styles into <head> <style> to improve the text-to-HTML ratio flagged by mail checkers. Removes the decorative watermark <img> (opacity 0.07, barely visible) which was the only image element and triggered the "too many images" classification. Cleans up the now-unused ProvisioningProperties dependency from EmailConnectorService and PasswordResetNotificationService. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,24 +35,16 @@ class EmailTemplateLoadingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void templatesContainWatermarkPlaceholder() throws IOException {
|
||||
void templatesContainHtmlStructure() 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");
|
||||
assertTrue(content.contains("<!DOCTYPE html>"),
|
||||
path + " must contain DOCTYPE declaration");
|
||||
assertTrue(content.contains("<html"),
|
||||
path + " must contain <html> tag");
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
|
||||
Reference in New Issue
Block a user