Skip to content

Commit

Permalink
Improved email client support for branded mails (#4663)
Browse files Browse the repository at this point in the history
Improves compatibility with Outlook mail clients, preventing harsh word breaks. Credit to @vevers.
  • Loading branch information
vevers authored and bennothommo committed Oct 14, 2019
1 parent 066b0c9 commit 0080f99
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions models/mailbrandsetting/custom.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -75,6 +74,7 @@ code {
color: @text-color;
font-size: 16px;
line-height: 1.5em;
word-break: break-all;
}

p.sub {
Expand All @@ -85,6 +85,10 @@ img {
max-width: 100%;
}

.break-all, .break-all * {
word-break: break-all;
}

/* Layout */

.wrapper {
Expand Down
2 changes: 1 addition & 1 deletion views/mail/partial-panel.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
==
{{ body|trim }}
==
<table class="panel" width="100%" cellpadding="0" cellspacing="0">
<table class="panel break-all" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="panel-content">
<table width="100%" cellpadding="0" cellspacing="0">
Expand Down
2 changes: 1 addition & 1 deletion views/mail/partial-promotion.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
==
{{ body|trim }}
==
<table class="promotion" align="center" width="100%" cellpadding="0" cellspacing="0">
<table class="promotion break-all" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
{{ body|md_safe }}
Expand Down

0 comments on commit 0080f99

Please sign in to comment.