From ab2431be11f9fe3e65c681edc36f743e589700ac Mon Sep 17 00:00:00 2001 From: martbost Date: Mon, 28 Sep 2026 05:22:24 -0500 Subject: [PATCH] Email an update: release notes are optional when there is an intro Co-Authored-By: Claude Fable 5.1 --- public/admin.html | 2 +- public/assets/admin.js | 2 +- updates.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/admin.html b/public/admin.html index b9670e1..ab9eb75 100644 --- a/public/admin.html +++ b/public/admin.html @@ -511,6 +511,6 @@ - + diff --git a/public/assets/admin.js b/public/assets/admin.js index dad78a6..4b069b8 100644 --- a/public/assets/admin.js +++ b/public/assets/admin.js @@ -555,7 +555,7 @@ $('updPreview').addEventListener('click', busy($('updPreview'), async () => { const r = await api('/api/admin/updates/preview', updInput()); $('updPre').hidden = false; $('updPre').textContent = 'Subject: ' + r.subject + '\n\n' + r.text; })); $('updTest').addEventListener('click', busy($('updTest'), async () => { const r = await api('/api/admin/updates/send', Object.assign(updInput(), { test: true })); IAP.status('Test sent to ' + r.to + '.', 'ok'); })); $('updSend').addEventListener('click', busy($('updSend'), async () => { - const inp = updInput(); if (!inp.noteIds.length) { IAP.status('Pick at least one note.', 'bad'); return; } + const inp = updInput(); if (!inp.noteIds.length && !String(inp.intro || '').trim()) { IAP.status('Write an intro or pick at least one note.', 'bad'); return; } const opt = $('updAudience').selectedOptions[0].textContent; if (!(await IAP.confirmBox('Send this update to ' + opt + '? One email per member, opt-outs skipped.', { title: 'Send member update', ok: 'Send now', cancel: 'Not yet' }))) return; const r = await api('/api/admin/updates/send', inp); IAP.status('Sending to ' + r.total + ' members in the background.', 'ok'); loadUpdates(); diff --git a/updates.js b/updates.js index 17a65ea..ac0f19a 100644 --- a/updates.js +++ b/updates.js @@ -59,7 +59,9 @@ function compose({ subject, intro, noteIds, closing }, acct) { let running = null; async function send(input, opts) { - const noteIds = (input.noteIds || []).map(String); if (!noteIds.length) return { error: 'Pick at least one release note.' }; + const noteIds = (input.noteIds || []).map(String); + // a plain message needs no release notes (Marty, 2026-09-28): notes OR an intro, never a forced note + if (!noteIds.length && !String(input.intro || '').trim()) return { error: 'Write an intro or pick at least one release note.' }; if (!R.mailer.hasKey()) return { error: 'The mailer is not configured on this server.' }; if (opts && opts.test) { const to = R.adminEmail; if (!to) return { error: 'No admin email configured.' };