From 21459ceec27a588e1523aa57721d1019995b84d1 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Wed, 18 Dec 2024 10:24:43 +0000 Subject: [PATCH] fixup! enable using announcements to add content to alerts --- scripts/alertmailer.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/alertmailer.php b/scripts/alertmailer.php index f252ab051e..fa828aed57 100644 --- a/scripts/alertmailer.php +++ b/scripts/alertmailer.php @@ -19,12 +19,17 @@ function mlog($message) { $text_banner = ''; $html_banner = ''; if ($banner) { - $text_banner = $banner->title . "\n\n" . $banner->content . "\n\n" . $banner->url . "\n\n"; - $link_text = "Read more"; - if (property_exists($banner, 'button_text')) { - $link_text = $banner->button_text; + $text_banner = $banner->title . "\n\n" . $banner->content . "\n\n"; + $html_banner = '

' . $banner->title . "

" . $banner->content . '

'; + + if (property_exists($banner, 'url') && $banner->url) { + $link_text = "Read more"; + if (property_exists($banner, 'button_text')) { + $link_text = $banner->button_text; + } + $text_banner .= $banner->url . "\n\n"; + $html_banner .= '

' . $link_text . '

'; } - $html_banner = '' . $banner->title . "

" . $banner->content . '

' . $link_text . '

'; } $global_start = getmicrotime();