From 185cb494c0e73d3ae642af9c28c90d7869341542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 19 Jul 2018 07:49:48 +0200 Subject: [PATCH 1/3] EMailTemplate: Move background color of buttons to the table to fix rendering in lotus notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Mail/EMailTemplate.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index 0ba411d692623..2bab43b137e22 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -229,12 +229,12 @@ class EMailTemplate implements IEMailTemplate {
- +
- @@ -282,12 +282,12 @@ class EMailTemplate implements IEMailTemplate {
+ %s
- +
- @@ -539,7 +539,7 @@ public function addBodyButtonGroup(string $textLeft, $color = $this->themingDefaults->getColorPrimary(); $textColor = $this->themingDefaults->getTextColorPrimary(); - $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); + $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); $this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL; $this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL; @@ -570,7 +570,7 @@ public function addBodyButton(string $text, string $url, $plainText = '') { $color = $this->themingDefaults->getColorPrimary(); $textColor = $this->themingDefaults->getTextColorPrimary(); - $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, $text]); + $this->htmlBody .= vsprintf($this->button, [$color, $color, $color, $url, $color, $textColor, $textColor, $text]); if ($plainText !== false) { $this->plainBody .= $plainText . ': '; From 7a4c23a7204591fb1aeeb14c56d86531c6e40f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 19 Jul 2018 11:17:49 +0200 Subject: [PATCH 2/3] Use index for format string parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Mail/EMailTemplate.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index 2bab43b137e22..4c56a316042ed 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -229,13 +229,13 @@ class EMailTemplate implements IEMailTemplate {
+ %s
- +
-
- %s + + %7\$s
@@ -248,7 +248,7 @@ class EMailTemplate implements IEMailTemplate {
- %s + %9\$s
@@ -282,13 +282,13 @@ class EMailTemplate implements IEMailTemplate {
- +
-
- %s + + %7\$s
@@ -539,7 +539,7 @@ public function addBodyButtonGroup(string $textLeft, $color = $this->themingDefaults->getColorPrimary(); $textColor = $this->themingDefaults->getTextColorPrimary(); - $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); + $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); $this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL; $this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL; @@ -570,7 +570,7 @@ public function addBodyButton(string $text, string $url, $plainText = '') { $color = $this->themingDefaults->getColorPrimary(); $textColor = $this->themingDefaults->getTextColorPrimary(); - $this->htmlBody .= vsprintf($this->button, [$color, $color, $color, $url, $color, $textColor, $textColor, $text]); + $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, $text]); if ($plainText !== false) { $this->plainBody .= $plainText . ': '; From 1213a7c6a2cdca6558e7e05464d8aa1e7b7bc75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 19 Jul 2018 10:48:17 +0200 Subject: [PATCH 3/3] Fix email template tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/Settings/Mailer/NewUserMailHelperTest.php | 8 ++++---- tests/data/emails/new-account-email-custom.html | 4 ++-- tests/data/emails/new-account-email-single-button.html | 4 ++-- tests/data/emails/new-account-email.html | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php index 6d6c6bf15c634..d59b371acfd23 100644 --- a/tests/Settings/Mailer/NewUserMailHelperTest.php +++ b/tests/Settings/Mailer/NewUserMailHelperTest.php @@ -281,12 +281,12 @@ public function testGenerateTemplateWithPasswordResetToken() {
- +
- @@ -518,12 +518,12 @@ public function testGenerateTemplateWithoutPasswordResetToken() {
+ Set your password
- +
- diff --git a/tests/data/emails/new-account-email-custom.html b/tests/data/emails/new-account-email-custom.html index 601aa0b63d4a1..2d2e01b7ab095 100644 --- a/tests/data/emails/new-account-email-custom.html +++ b/tests/data/emails/new-account-email-custom.html @@ -114,12 +114,12 @@

+ Go to TestCloud
- +
- diff --git a/tests/data/emails/new-account-email-single-button.html b/tests/data/emails/new-account-email-single-button.html index db8ab868682c1..279822e21cc4f 100644 --- a/tests/data/emails/new-account-email-single-button.html +++ b/tests/data/emails/new-account-email-single-button.html @@ -114,12 +114,12 @@

+ Set your password
- +
- diff --git a/tests/data/emails/new-account-email.html b/tests/data/emails/new-account-email.html index f7ffbb8abf659..3835fc3d540a2 100644 --- a/tests/data/emails/new-account-email.html +++ b/tests/data/emails/new-account-email.html @@ -114,12 +114,12 @@

+ Set your password
- +
-
+ Set your password