From d52c59254aaa141fe0ee6f187eed8a3268ff831d Mon Sep 17 00:00:00 2001
From: Valentijn Evers <32770383+vevers@users.noreply.github.com>
Date: Mon, 14 Oct 2019 09:33:43 +0200
Subject: [PATCH] Improved email client support for branded mails (#4663)
Improves compatibility with Outlook mail clients, preventing harsh word breaks. Credit to @vevers.
---
modules/system/models/mailbrandsetting/custom.less | 8 ++++++--
modules/system/views/mail/partial-panel.htm | 2 +-
modules/system/views/mail/partial-promotion.htm | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/system/models/mailbrandsetting/custom.less b/modules/system/models/mailbrandsetting/custom.less
index 430f50bbc..f75a5b6cd 100644
--- a/modules/system/models/mailbrandsetting/custom.less
+++ b/modules/system/models/mailbrandsetting/custom.less
@@ -13,11 +13,10 @@ body {
line-height: 1.4;
margin: 0;
-moz-hyphens: auto;
- -ms-word-break: break-all;
+ -ms-word-break: break-word;
width: 100% !important;
-webkit-hyphens: auto;
-webkit-text-size-adjust: none;
- word-break: break-all;
word-break: break-word;
}
@@ -75,6 +74,7 @@ code {
color: @text-color;
font-size: 16px;
line-height: 1.5em;
+ word-break: break-all;
}
p.sub {
@@ -85,6 +85,10 @@ img {
max-width: 100%;
}
+.break-all, .break-all * {
+ word-break: break-all;
+}
+
/* Layout */
.wrapper {
diff --git a/modules/system/views/mail/partial-panel.htm b/modules/system/views/mail/partial-panel.htm
index fa6ef4a9f..5fdb48eb0 100644
--- a/modules/system/views/mail/partial-panel.htm
+++ b/modules/system/views/mail/partial-panel.htm
@@ -2,7 +2,7 @@ name = "Panel"
==
{{ body|trim }}
==
-
+
diff --git a/modules/system/views/mail/partial-promotion.htm b/modules/system/views/mail/partial-promotion.htm
index fe9e877fc..90854f3a6 100644
--- a/modules/system/views/mail/partial-promotion.htm
+++ b/modules/system/views/mail/partial-promotion.htm
@@ -2,7 +2,7 @@ name = "Promotion"
==
{{ body|trim }}
==
- |