Weekly member email as sectioned HTML (plain-text twin kept); PassiveDrip one-tap hand-off (inert until PD_SSO_SECRET)

- coach.js: weeklyDigest() builds one card per topic (credits, streak, contest, tank, team) with the key number up front and one button; mailer.send takes optional html
- server.js: /api/my/passivedrip mints a signed hand-off (memberId, email, username, verified wallet, sponsor email); Games card for PassiveDrip (admin preview until gamesLive includes passivedrip) with the member's own coins line via the bridge 'member' lookup; sign-in return path
- my.js: card button label, return redirect; v=20261001b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-01 08:43:22 -05:00
parent dd53d132d6
commit 5a522f0ede
7 changed files with 160 additions and 51 deletions
+4 -2
View File
@@ -15,13 +15,15 @@ function key() {
}
function hasKey() { return !!key(); }
function send(to, subject, text) {
function send(to, subject, text, html) { // html optional (2026-10-01): sent alongside the plain text, never instead of it
return new Promise((resolve, reject) => {
const content = [{ type: 'text/plain', value: text }];
if (html) content.push({ type: 'text/html', value: html });
const body = JSON.stringify({
personalizations: [{ to: [{ email: to }] }],
from: FROM,
subject,
content: [{ type: 'text/plain', value: text }]
content
});
const req = https.request({ hostname: 'api.sendgrid.com', path: '/v3/mail/send', method: 'POST',
headers: { Authorization: 'Bearer ' + key(), 'Content-Type': 'application/json',