Admin > Releases: email an update to members (pick notes, intro, audience, preview, test, send; opt-outs honoured; send log)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -97,10 +97,11 @@ async function unsubscribe(email, t) {
|
||||
const e = String(email || '').trim().toLowerCase();
|
||||
if (!e || !t || t !== token(e)) return { error: 'That link is not valid.' };
|
||||
const cur = await impl().get(e);
|
||||
if (!cur) return { ok: true, already: true };
|
||||
if (!cur) { try { await enqueue(e, '', ''); await impl().update(e, { stopped: 2 }); } catch (err) {} return { ok: true }; } // member without a drip row: record the opt-out anyway (update emails honour it)
|
||||
await impl().update(e, { stopped: 2 });
|
||||
return { ok: true };
|
||||
}
|
||||
async function isUnsubscribed(email) { const cur = await impl().get(String(email || '').toLowerCase()); return !!(cur && cur.stopped === 2); }
|
||||
|
||||
// ---- rendering ----
|
||||
async function vars(email) {
|
||||
@@ -178,4 +179,4 @@ async function tick() {
|
||||
}
|
||||
async function stats() { return impl().stats(); }
|
||||
|
||||
module.exports = { init, enqueue, tick, stats, sequence, setSequence, resetSequence, sendStep, unsubscribe, unsubUrl, DEFAULT_SEQUENCE };
|
||||
module.exports = { init, enqueue, tick, stats, sequence, setSequence, resetSequence, sendStep, unsubscribe, unsubUrl, isUnsubscribed, DEFAULT_SEQUENCE };
|
||||
|
||||
Reference in New Issue
Block a user