[object Object]

← back to Dw Pitch Followup

Auto-swap to a thank-you letter when client has a BOOKED order since sampling (references the order + project); quote-since-sampling still gets the follow-up (chase the close)

d191c5c0b770f77375362ce442e2ee5edf8f6492 · 2026-07-07 16:06:42 -0700 · Steve Abrams

Files touched

Diff

commit d191c5c0b770f77375362ce442e2ee5edf8f6492
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jul 7 16:06:42 2026 -0700

    Auto-swap to a thank-you letter when client has a BOOKED order since sampling (references the order + project); quote-since-sampling still gets the follow-up (chase the close)
---
 server.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/server.js b/server.js
index 599af55..df59d32 100644
--- a/server.js
+++ b/server.js
@@ -264,6 +264,20 @@ function composeDeterministic(list, row, ctx, seed, showMfr) {
 
   const tradeLine = isTrade ? ' And since custom work and sourcing are our specialty, we can tailor anything here for your project or client.' : '';
 
+  // CONVERTED: if they BOOKED an order since we sent samples, thank them — don't chase a purchase.
+  const bookedPost = (Array.isArray(row.post_sample_invoices) ? row.post_sample_invoices : []).filter((i) => i.booked);
+  if (bookedPost.length) {
+    const orderRef = bookedPost.length === 1 ? ` (order #${bookedPost[0].invoice})` : '';
+    const tyBody =
+      `Hi ${greetName},\n\n` +
+      `${g} Thank you so much for your recent order${projRef}${orderRef} — we’re so glad it’s on its way, and we’re right here if you need anything to bring the space together.${tradeLine} If you’d like coordinating options or a quick stock check on anything else, just say the word.\n\n` +
+      `And if another project is on your desk, we’d love to help you source or customize whatever you need. ${q}\n\n` +
+      `${signNames} — Designer Wallcoverings\n` +
+      `designerwallcoverings.com  ·  1-888-373-4564\n\n` +
+      `P.S. If you’d like to hop on a quick call, just let us know a good time.`;
+    return { subject: 'Thank you for your order — Designer Wallcoverings', body: tyBody, engine: 'thank-you' };
+  }
+
   // ~3 tight sentences: (1) follow-up + final-purchase ask, (2) witty samples/stock + we're-here-to-help
   // [+trade], (3) project-details line then a closing question. Then the sample reminder + sign-off + PS.
   const body =

← 4f8a57a Flag invoices placed SINCE samples sent (possible conversion  ·  back to Dw Pitch Followup  ·  yolo/contrarian fixes: build-time TODAY (fix aging bug) + 30 ff19558 →