Email an update: release notes are optional when there is an intro
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -511,6 +511,6 @@
|
||||
</div>
|
||||
|
||||
<script src="/assets/common.js?v=20260923b"></script><script src="/assets/welcome.js?v=20260923b"></script>
|
||||
<script src="/assets/admin.js?v=20260928b"></script>
|
||||
<script src="/assets/admin.js?v=20260928c"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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();
|
||||
|
||||
+3
-1
@@ -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.' };
|
||||
|
||||
Reference in New Issue
Block a user