From 32525d970d98b65e4fbe93668f5bf2ccec5fd9c0 Mon Sep 17 00:00:00 2001 From: Leeroy <175472781+leeroy1821@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:32:24 +0200 Subject: [PATCH] URL in email broken with Mail Template Layout Fix https://github.com/joomla/joomla-cms/issues/44377 --- libraries/src/Mail/MailTemplate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/src/Mail/MailTemplate.php b/libraries/src/Mail/MailTemplate.php index 17bd3671c3bbb..c718d1daac197 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -328,8 +328,6 @@ public function send() $htmlBody = nl2br($this->replaceTags(Text::_($mail->body), $plainData, true), false); } - $htmlBody = MailHelper::convertRelativeToAbsoluteUrls($htmlBody); - if ($useLayout) { // Add additional data to the layout template $this->addLayoutTemplateData([ @@ -381,6 +379,8 @@ public function send() $htmlBody = $this->replaceTags(Text::_($htmlBody), $this->data); } + $htmlBody = MailHelper::convertRelativeToAbsoluteUrls($htmlBody); + $this->mailer->setBody($htmlBody); }