Skip to content

Commit

Permalink
fixup! enable using announcements to add content to alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Dec 18, 2024
1 parent 9c9dbcf commit 21459ce
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/alertmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<p><strong>' . $banner->title . "</strong></p><p>" . $banner->content . '</p>';

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 .= '<p><a href="' . $banner->url . '">' . $link_text . '</a></p>';
}
$html_banner = '<strong>' . $banner->title . "</strong><p>" . $banner->content . '</p><p><a href="' . $banner->url . '">' . $link_text . '</a></p>';
}

$global_start = getmicrotime();
Expand Down

0 comments on commit 21459ce

Please sign in to comment.