← back to Sample Followup Sweep
letter: show Ref # (DW order ref) + Date Ordered per memo line so suppliers can locate/quote each item
9e48b0a1d664b8162759a04648ab017218d44a37 · 2026-08-20 10:39:24 -0700 · Steve
Files touched
M lib/compose.jsM scripts/scheduled-run.mjs
Diff
commit 9e48b0a1d664b8162759a04648ab017218d44a37
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Aug 20 10:39:24 2026 -0700
letter: show Ref # (DW order ref) + Date Ordered per memo line so suppliers can locate/quote each item
---
lib/compose.js | 25 ++++++++++++++++---------
scripts/scheduled-run.mjs | 4 ++--
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/lib/compose.js b/lib/compose.js
index e5f1e64..dce694f 100644
--- a/lib/compose.js
+++ b/lib/compose.js
@@ -10,9 +10,13 @@ function compose(vendor, rows) {
const account = vendor.account_number || '‹CONFIRM DW ACCOUNT #›';
// Steve 8/20: fall back to the vendor's main email when no sample email exists.
const to = vendor.sample_email || vendor.main_email || '‹CONFIRM SAMPLE EMAIL›';
- const lines = rows
- .map(r => (r.gap_before ? '<br>\n' : '') + esc(r.mfr))
- .join('<br>\n');
+ // Steve 8/20: each memo line shows the DATE WE ORDERED it + a REFERENCE # (our DW order
+ // number) alongside the manufacturer #, so the supplier can locate + quote each item easily.
+ const rowsHtml = rows.map(r => `<tr style="border-bottom:1px solid #eee">
+<td style="padding:5px 18px 5px 0;white-space:nowrap"><strong>${esc(r.sku || '—')}</strong></td>
+<td style="padding:5px 18px 5px 0;white-space:nowrap">${esc(r.requested || '—')}</td>
+<td style="padding:5px 0">${esc(r.mfr)}</td>
+</tr>`).join('\n');
const subject = `Sample Follow-Up — Outstanding Memos (Acct ${account}) — Designer Wallcoverings`;
const s = vendor.ship_to;
@@ -22,12 +26,15 @@ function compose(vendor, rows) {
Hopefully we removed any disco items internally from this list before asking again.</p>
<hr style="border:none;border-top:1px solid #ccc">
<p><strong>Our account number is ${esc(account)}</strong></p>
-<p>We ordered 1 memo sample of each item below:</p>
-<p><strong>Manufacturer Number</strong></p>
-<hr style="border:none;border-top:1px solid #ccc">
-<p style="line-height:1.7">
-${lines}
-</p>
+<p>We ordered 1 memo sample of each item below. The <strong>Ref #</strong> is our order reference — please quote it when you reply about an item.</p>
+<table style="border-collapse:collapse;font-size:14px;margin:8px 0">
+<tr style="text-align:left;border-bottom:2px solid #333">
+<th style="padding:5px 18px 5px 0">Ref #</th>
+<th style="padding:5px 18px 5px 0">Date Ordered</th>
+<th style="padding:5px 0">Manufacturer #</th>
+</tr>
+${rowsHtml}
+</table>
<hr style="border:none;border-top:1px solid #ccc">
<p>Ship to the address below.</p>
<p><strong>Sidemark: Samples ASAP</strong></p>
diff --git a/scripts/scheduled-run.mjs b/scripts/scheduled-run.mjs
index b432346..044bc15 100644
--- a/scripts/scheduled-run.mjs
+++ b/scripts/scheduled-run.mjs
@@ -161,7 +161,7 @@ const run = async () => {
if (DRAFT) {
const fresh = rows.filter((r) => !draftLedger[r.recordId]); // only newly-outstanding SKUs
if (!fresh.length) continue; // already drafted — no dup
- const draft = compose({ name: c.name, account_number: c.account_number, sample_email: c.sample_email, main_email: c.main_email, ship_to: SHIP_TO }, fresh.map((r) => ({ mfr: r.mfr })));
+ const draft = compose({ name: c.name, account_number: c.account_number, sample_email: c.sample_email, main_email: c.main_email, ship_to: SHIP_TO }, fresh.map((r) => ({ mfr: r.mfr, sku: r.sku, requested: r.requested })));
const res = await georgeDraft({ account: 'info', to: draft.to, subject: draft.subject, body: draft.html });
if (res.ok) {
for (const r of fresh) draftLedger[r.recordId] = today; // dedup marker (NOT a FileMaker stamp)
@@ -169,7 +169,7 @@ const run = async () => {
} else { skipped.push({ vid, n: fresh.length, reason: 'George draft failed: ' + res.detail }); }
continue;
}
- const draft = compose({ name: c.name, account_number: c.account_number, sample_email: c.sample_email, main_email: c.main_email, ship_to: SHIP_TO }, rows.map((r) => ({ mfr: r.mfr })));
+ const draft = compose({ name: c.name, account_number: c.account_number, sample_email: c.sample_email, main_email: c.main_email, ship_to: SHIP_TO }, rows.map((r) => ({ mfr: r.mfr, sku: r.sku, requested: r.requested })));
if (!SEND) { sent.push({ vid, name: c.name, to: draft.to, n: rows.length, skus: rows.map((r) => r.sku), dryRun: true }); continue; }
const res = await georgeSend({ account: 'info', to: draft.to, subject: draft.subject, body: draft.html });
if (res.ok) {
← 2961d0e run: 26 Gmail drafts created via --draft (9 newly-enriched v
·
back to Sample Followup Sweep
·
auto-data-snapshot: 2026-08-20T10:47:55 (2 data files) — dat 4faf95e →