diff --git a/src/mailer/components/mailers/SystemMailer.php b/src/mailer/components/mailers/SystemMailer.php index b81f6af5..b4d9ecd3 100644 --- a/src/mailer/components/mailers/SystemMailer.php +++ b/src/mailer/components/mailers/SystemMailer.php @@ -127,9 +127,11 @@ public function getSendTestModalHtml(EmailElement $email): string { $testToEmailAddress = Craft::$app->getConfig()->getGeneral()->testToEmailAddress; - if ($testToEmailAddress) { + if (!empty($testToEmailAddress)) { $warningMessage = Craft::t('sprout-module-mailer', 'Test email found in general config. All messages will be sent to the testToEmailAddress: {email}', [ - 'email' => $testToEmailAddress, + 'email' => is_array($testToEmailAddress) + ? implode(', ', $testToEmailAddress) + : $testToEmailAddress, ]); } diff --git a/src/mailer/components/mailers/fieldlayoutelements/TestToEmailUiElement.php b/src/mailer/components/mailers/fieldlayoutelements/TestToEmailUiElement.php index d9cdf340..d5a90ae2 100644 --- a/src/mailer/components/mailers/fieldlayoutelements/TestToEmailUiElement.php +++ b/src/mailer/components/mailers/fieldlayoutelements/TestToEmailUiElement.php @@ -27,7 +27,9 @@ public function formHtml(?ElementInterface $element = null, bool $static = false $id = sprintf('warning%s', mt_rand()); $message = Markdown::process(Html::encode(Craft::t('sprout-module-mailer', 'Test email found in general config. All messages will be sent to the testToEmailAddress: {email}', [ - 'email' => $testToEmailAddress, + 'email' => is_array($testToEmailAddress) + ? implode(', ', $testToEmailAddress) + : $testToEmailAddress, ]))); $blockquote = Html::tag('blockquote', $message, [ @@ -39,6 +41,6 @@ public function formHtml(?ElementInterface $element = null, bool $static = false 'class' => 'readable', ]); - return $testToEmailAddress ? $html : null; + return !empty($testToEmailAddress) ? $html : null; } }