[object Object]

← back to Reidwitlin Landing

buy-from distributor support: Artmura purchases route via NewWall (tricia@newwall.com, 866-770-2111, 20% newwall registry discount) — emails greet the distributor, PDP shows Buy From row

7aa3cbb1a5bb1f670d24cfe3eeeabda525399206 · 2026-07-02 11:32:42 -0700 · Steve Abrams

Files touched

Diff

commit 7aa3cbb1a5bb1f670d24cfe3eeeabda525399206
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 2 11:32:42 2026 -0700

    buy-from distributor support: Artmura purchases route via NewWall (tricia@newwall.com, 866-770-2111, 20% newwall registry discount) — emails greet the distributor, PDP shows Buy From row
---
 lib/vendor-requests.js | 9 ++++++---
 public/product.html    | 3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/vendor-requests.js b/lib/vendor-requests.js
index 9c22948..37d0fb2 100644
--- a/lib/vendor-requests.js
+++ b/lib/vendor-requests.js
@@ -41,7 +41,10 @@ function db() {
 const esc = s => String(s == null ? '' : s).replace(/[&<>]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;' }[c]));
 
 // ---- email composition — polite, account-number-only, client-anonymous ----
+// vendor.buy_from = distributor that carries the line (e.g. Artmura via NewWall):
+// the email greets the distributor; the line name stays in the subject/item.
 function composeEmail(type, vendor, item, reqNo) {
+  const who = vendor.buy_from || vendor.name;
   const acct = vendor.account_number || null;
   const ask = type === 'stock'
     ? 'Could you please check current stock availability on the following item?'
@@ -54,7 +57,7 @@ function composeEmail(type, vendor, item, reqNo) {
     ['Note', item.note],
   ].filter(r => r[1]);
   const body = [
-    `<p>Hello ${esc(vendor.name)} team,</p>`,
+    `<p>Hello ${esc(who)} team,</p>`,
     `<p>${ask}</p>`,
     `<p>${rows.map(r => `&nbsp;&nbsp;&nbsp;&nbsp;<b>${esc(r[0])}:</b> ${esc(r[1])}`).join('<br>')}</p>`,
     `<p>This is for Designer Wallcoverings${acct ? `, account #${esc(acct)}` : ''}. Please reference <b>${reqNo}</b> in your reply.</p>`,
@@ -116,14 +119,14 @@ function mountVendorRequests(app, { vendorCode, getVendor, dataDir }) {
         message = `${reqNo} logged — purchasing will order the memo sample.`;
       } else if (!vendor.email) {
         status = 'no_email';
-        message = `${reqNo} logged. No vendor email on file — call ${vendor.name || 'the vendor'}${vendor.phone ? ' at ' + vendor.phone : ''}.`;
+        message = `${reqNo} logged. No vendor email on file — call ${vendor.buy_from || vendor.name || 'the vendor'}${vendor.phone ? ' at ' + vendor.phone : ''}.`;
       } else {
         mail = composeEmail(type, vendor, { dw_sku, mfr_sku, title, qty, note }, reqNo);
         const to = process.env.REQUEST_EMAIL_OVERRIDE || vendor.email; // override = smoke-test only
         const sent = await georgeSend({ to, ...mail });
         if (sent.success) {
           status = 'emailed'; emailed = true;
-          message = `${reqNo} sent to ${vendor.name} (${to}).`;
+          message = `${reqNo} sent to ${vendor.buy_from || vendor.name} (${to}).`;
         } else {
           status = 'email_failed';
           message = `${reqNo} logged, but the email failed (${sent.error || 'status ' + sent.status}) — call ${vendor.phone || 'the vendor'}.`;
diff --git a/public/product.html b/public/product.html
index 14fd5e6..164ce94 100644
--- a/public/product.html
+++ b/public/product.html
@@ -111,9 +111,10 @@ function priceBox(p){
           <button class="cta" data-act="price">Get Price</button>
         </div>
         ${!VM.email?`<div class="noemail">✉️ No vendor email on file — stock &amp; price checks are logged internally; confirm by phone${VM.phone?': '+esc(VM.phone):''}.</div>`:''}
-        ${VM.phone?`<a class="cta ghost call" href="tel:+1${(VM.phone||'').replace(/[^0-9]/g,'')}">📞 Call ${esc(VM.name||LINE)} — ${esc(VM.phone)}${VM.account_number?' · Acct # '+esc(VM.account_number):''}</a>`:''}
+        ${VM.phone?`<a class="cta ghost call" href="tel:+1${(VM.phone||'').replace(/[^0-9]/g,'')}">📞 Call ${esc(VM.buy_from||VM.name||LINE)} — ${esc(VM.phone)}${VM.account_number?' · Acct # '+esc(VM.account_number):''}</a>`:''}
         <div class="spec">
           ${specRow('Vendor',VM.name||LINE)}
+          ${specRow('Buy From / Distributor',VM.buy_from)}
           ${specRow('Vendor SKU / Model #',p.sku)}
           ${specRow('DW SKU',p.dw_sku)}
           ${specRow('Our Account #',VM.account_number)}

← b5d7742 chore: lint clean, refactor, v0.2.0 (session close)  ·  back to Reidwitlin Landing  ·  discounts are line-specific (Steve): Artmura % unconfirmed — 466dd2a →