SSR alert mail recipients maintainable in the site settings

New site setting vitec.ssr.alertEmails (Site Management, Settings, VITEC; one address per entry). vitec:ssr-health reads the recipients from there, invalid entries are skipped and logged, SSR_ALERT_EMAIL in the env file stays as fallback. The cockpit shows the recipients in the live band. Pre-filled with the address that was in the env file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
orascheandClaude Opus 5.5 committed 2026-11-11 11:13:37 +01:00
1 parent 994f9f2a1b
commit 90cb2faaf9
6 files changed
+81 -6

No files matched your search

@@ -206,15 +206,20 @@ final class SsrHealthSampleCommand extends Command
/**
* Mails are best effort: a mail problem must never break the sampler
* (the cron would stop logging history). Recipients come from
* SSR_ALERT_EMAIL in var/vitec-ssr-purge.env - unset means "alerts
* off", which the output states so the cron log shows why.
* (the cron would stop logging history). Recipients come from the site
* setting vitec.ssr.alertEmails (Site Management › Settings › VITEC),
* fallback SSR_ALERT_EMAIL in var/vitec-ssr-purge.env - none at all
* means "alerts off", which the output states so the cron log shows why.
*/
private function sendAlert(string $subject, string $body, OutputInterface $output): void
{
$recipients = GeneralUtility::trimExplode(',', $this->purgeService->getAlertEmail(), true);
$alert = $this->purgeService->getAlertRecipients();
if ($alert['invalid'] !== []) {
$output->writeln('<comment>skipped invalid alert addresses: ' . implode(', ', $alert['invalid']) . '</comment>');
}
$recipients = $alert['recipients'];
if ($recipients === []) {
$output->writeln('<comment>transition detected but SSR_ALERT_EMAIL is not configured - no mail sent</comment>');
$output->writeln('<comment>transition detected but no alert recipients are configured (Site settings › VITEC or SSR_ALERT_EMAIL) - no mail sent</comment>');
return;
}
try {