From fdca67c40146db62efe3ed669c23e49b4931f490 Mon Sep 17 00:00:00 2001 From: Cathode Ray Dude <46694173+cathoderaydude@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:39:27 -0700 Subject: [PATCH] Added check to moderator notification --- action.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/action.php b/action.php index b33f240..34080bb 100644 --- a/action.php +++ b/action.php @@ -1411,9 +1411,13 @@ protected function notify($comment, &$subscribers) } } $bccs = array_unique($bccs); - // notify the users - $mailer->bcc(implode(',', $bccs)); - $mailer->send(); + // notify the users if any were found + if (count($bccs) > 0) { + $mailer->bcc(implode(',', $bccs)); + $mailer->send(); + } else { + dbglog("moderatorgroups field set, but no valid users or groups found. Not sending email."); + } } } }