From efe3859c2e0bc7832bf8dcb74d09768ab15b505d Mon Sep 17 00:00:00 2001 From: Elias Tertsunen Date: Tue, 23 May 2023 12:24:58 +0000 Subject: [PATCH] Notify municipality recipients on empty channel If a question has a channel with no recipient groups defined, then email notifications should be sent to possible municipality recipients. --- src/Plugin/Action/SendQuestionNotifyEmail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin/Action/SendQuestionNotifyEmail.php b/src/Plugin/Action/SendQuestionNotifyEmail.php index 7a1a370..d685c0e 100644 --- a/src/Plugin/Action/SendQuestionNotifyEmail.php +++ b/src/Plugin/Action/SendQuestionNotifyEmail.php @@ -31,7 +31,7 @@ public function execute($question = NULL) { */ if ($library = $question->getTargetLibrary()) { $recipients = array_merge($recipients, $this->getGroupRecipients($library)); - } else if ($channel = $question->getChannel()) { + } else if (($channel = $question->getChannel()) && !empty($this->getChannelRecipients($channel))) { $recipients = array_merge($recipients, $this->getChannelRecipients($channel)); } else if ($city = $question->getMunicipality()) { $recipients = array_merge($recipients, $this->getGroupRecipients($city));