Send backup alerts to a person, not just the shared inbox
Deploy web to NAS / deploy (push) Successful in 1m2s
Deploy web to NAS / deploy (push) Successful in 1m2s
Failures went to REPORT_EMAIL, which is the media@ shared inbox the Sunday digest already uses. An alert competing with a routine weekly mail in a shared inbox is an alert that gets scrolled past, which is most of the way back to the logfile nobody read. ALERT_EMAIL is now a separate, comma-separated list for breakage only, falling back to REPORT_EMAIL so a machine whose .env predates this still alerts somewhere rather than silently not at all. Verified by sending one test alert, which arrived. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
3d82e46951
commit
ff6785b800
+8
-2
@@ -42,8 +42,14 @@ async function main() {
|
||||
if (!subject) { console.error('alert.js: no subject given'); process.exit(1); }
|
||||
|
||||
const env = readEnv(ENV_FILE);
|
||||
const to = env.REPORT_EMAIL;
|
||||
if (!to) { console.error(`alert.js: no REPORT_EMAIL in ${ENV_FILE}`); process.exit(1); }
|
||||
// ALERT_EMAIL is for things that are broken; REPORT_EMAIL is for the Sunday digest. They
|
||||
// are separate because an alert that only reaches a shared inbox is easy to scroll past,
|
||||
// and because the digest should not become a channel people learn to ignore. Comma
|
||||
// separated, and it falls back to REPORT_EMAIL so a machine whose .env predates this
|
||||
// still alerts somewhere rather than silently not at all.
|
||||
const to = (env.ALERT_EMAIL || env.REPORT_EMAIL || '')
|
||||
.split(',').map(a => a.trim()).filter(Boolean).join(', ');
|
||||
if (!to) { console.error(`alert.js: no ALERT_EMAIL or REPORT_EMAIL in ${ENV_FILE}`); process.exit(1); }
|
||||
if (!env.SMTP_HOST || !env.SMTP_USER || !env.SMTP_PASS) {
|
||||
console.error(`alert.js: SMTP is not configured in ${ENV_FILE}`); process.exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user