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
+2
View File
@@ -5,6 +5,7 @@
const fs = require('fs');
const path = require('path');
const db = require('./db');
const walletnudge = require('./walletnudge'); // POL waiting in the games with no wallet linked
let DATA_DIR = null, chain = null, accounts = null, mailer = null;
const DAY = 86400000;
@@ -80,6 +81,7 @@ async function coachView(email) {
// PIF gift target: a direct with a linked wallet who has NOT bought a package yet (rung < 3). Switching payouts on
// no longer hides the button (Marty 2026-10-07: a prospect with payouts on still needed his first $20).
c.address = (d.address && c.rung < 3) ? d.address : null;
c.polWaiting = d.address ? 0 : walletnudge.waitingFor(d.email); // earned in the games, stuck behind a missing wallet
out.push(Object.assign({ email: d.email, name: d.username ? '@' + d.username : (d.memberId ? 'member #' + d.memberId : d.email.replace(/^(.).*(@.*)$/, '$1***$2')), memberId: d.memberId || 0 }, c));
}
// most actionable first: stalled lowest rung, then quiet days