Skip to content

Commit

Permalink
Allow custom HTML in HTML Emails
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jan 24, 2018
1 parent 5520ba3 commit 8a9089f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/private/Mail/EMailTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public function addBodyText($text, $plainText = '') {

$this->ensureBodyIsOpened();

$this->htmlBody .= vsprintf($this->bodyText, [htmlspecialchars($text)]);
$this->htmlBody .= vsprintf($this->bodyText, [$text]);
if ($plainText !== false) {
$this->plainBody .= $plainText . PHP_EOL . PHP_EOL;
}
Expand Down Expand Up @@ -462,9 +462,9 @@ public function addBodyListItem($text, $metaInfo = '', $icon = '', $plainText =
$plainMetaInfo = $metaInfo;
}

$htmlText = htmlspecialchars($text);
$htmlText = $text;
if ($metaInfo) {
$htmlText = '<em style="color:#777;">' . htmlspecialchars($metaInfo) . '</em><br>' . $htmlText;
$htmlText = '<em style="color:#777;">' . $metaInfo . '</em><br>' . $htmlText;
}
if ($icon !== '') {
$icon = '<img src="' . htmlspecialchars($icon) . '" alt="&bull;">';
Expand Down Expand Up @@ -533,7 +533,7 @@ public function addBodyButtonGroup($textLeft,
$color = $this->themingDefaults->getColorPrimary();
$textColor = $this->themingDefaults->getTextColorPrimary();

$this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, htmlspecialchars($textLeft), $urlRight, htmlspecialchars($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;

Expand Down Expand Up @@ -563,7 +563,7 @@ public function addBodyButton($text, $url, $plainText = '') {

$color = $this->themingDefaults->getColorPrimary();
$textColor = $this->themingDefaults->getTextColorPrimary();
$this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, htmlspecialchars($text)]);
$this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, $text]);

if ($plainText !== false) {
$this->plainBody .= $plainText . ': ';
Expand Down

0 comments on commit 8a9089f

Please sign in to comment.