Wallet-link nudges: hourly job asks each game (signed with the shared secret) for players with POL waiting and no wallet, sends up to three notices per person (now, 3 days, 10 days) in-app and by opt-in email, stops when a wallet is linked; coach directs badge "POL waiting, no wallet"; admin view and run endpoint

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-07 10:35:16 -05:00
parent ca065e456e
commit 616bd37142
6 changed files with 111 additions and 3 deletions
+1 -1
View File
@@ -110,4 +110,4 @@ function draft() { try { return JSON.parse(fs.readFileSync(DRAFT(), 'utf8')); }
function saveDraft(d) { const v = { subject: String(d.subject || '').slice(0, 150), intro: String(d.intro || '').slice(0, 8000), closing: String(d.closing || '').slice(0, 2000), noteIds: (d.noteIds || []).map(String).slice(0, 40), audience: AUDIENCES[d.audience] ? d.audience : 'optin', savedAt: Date.now() }; try { fs.writeFileSync(DRAFT(), JSON.stringify(v)); } catch (e) {} return v; }
function status() { const l = log(); if (running) { const k = l.sends.find(x => x.id === running.id); if (k) Object.assign(k, running); } return { sends: l.sends.slice(0, 12), running: !!running }; }
function lastSentAt() { const l = log(); const d = l.sends.find(x => x.status === 'done'); return d ? d.ts : 0; }
module.exports = { init, AUDIENCES, counts, countsSnapshot, compose, send, status, lastSentAt, draft, saveDraft };
module.exports = { init, AUDIENCES, counts, countsSnapshot, compose, send, status, lastSentAt, draft, saveDraft, optedIn };