← back to Designer Wallcoverings
Add Majilite Metallic Specialties I Constant Contact campaign (draft created 86aafad2)
692b87fe7f8740c2aae1f562eddb1cd9cb3b44b1 · 2026-08-10 12:06:00 -0700 · Steve Abrams
Files touched
A mailers/cc-api/build-majilite-campaign.jsA mailers/majilite-metallic-specialties.html
Diff
commit 692b87fe7f8740c2aae1f562eddb1cd9cb3b44b1
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Aug 10 12:06:00 2026 -0700
Add Majilite Metallic Specialties I Constant Contact campaign (draft created 86aafad2)
---
mailers/cc-api/build-majilite-campaign.js | 134 +++++++++++++++++++++++++++++
mailers/majilite-metallic-specialties.html | 71 +++++++++++++++
2 files changed, 205 insertions(+)
diff --git a/mailers/cc-api/build-majilite-campaign.js b/mailers/cc-api/build-majilite-campaign.js
new file mode 100644
index 00000000..c1a1f3cc
--- /dev/null
+++ b/mailers/cc-api/build-majilite-campaign.js
@@ -0,0 +1,134 @@
+'use strict';
+
+/**
+ * build-hollywood-campaign.js — Designer Wallcoverings
+ * A DUPLICATE of build-pr-naturals-campaign.js (same validation + create path),
+ * pointed at ../hollywood-launch.html. Promotes this week's storewide New Arrivals.
+ *
+ * --dry-run (DEFAULT): prints payload + validation checklist. NO network.
+ * --confirm : creates the DRAFT campaign — STILL double-gated by
+ * CC_LIVE === '1' inside cc-client. Creating a DRAFT
+ * does NOT send; scheduling/sending is a separate gate.
+ */
+
+const fs = require('fs');
+const path = require('path');
+const cc = require('./cc-client');
+
+const MAILER = path.join(__dirname, '..', 'majilite-metallic-specialties.html');
+
+const argv = process.argv.slice(2);
+const CONFIRM = argv.includes('--confirm');
+const DRY_RUN = argv.includes('--dry-run') || !CONFIRM; // default dry-run
+
+const CAMPAIGN = {
+ name: `Majilite Metallic Specialties I — ${new Date().toISOString().slice(0, 10)}`,
+ subject: 'New: Majilite Metallic Specialties I — 160 luxe metallic finishes',
+ preheader: 'Breathable, durable Nytek faux leather for walls & seating. Order swatches from the new collection.',
+ fromName: 'Designer Wallcoverings',
+ fromEmail: 'steve@designerwallcoverings.com',
+ replyTo: 'steve@designerwallcoverings.com',
+ physicalAddress: {
+ address_line1: '15442 Ventura Bl',
+ city: 'Sherman Oaks',
+ state_code: 'CA',
+ postal_code: '91403',
+ country_code: 'US',
+ },
+};
+
+const PLACEHOLDER_ADDRESS_MARKER = '15442 Ventura Boulevard #102';
+
+function loadHtml() {
+ if (!fs.existsSync(MAILER)) throw new Error(`mailer not found: ${MAILER}`);
+ return fs.readFileSync(MAILER, 'utf8');
+}
+function extractImageSrcs(html) {
+ const srcs = []; const re = /<img\b[^>]*?\bsrc\s*=\s*(["'])(.*?)\1/gi; let m;
+ while ((m = re.exec(html)) !== null) srcs.push(m[2]);
+ return srcs;
+}
+const isAbsoluteHttps = (u) => /^https:\/\//i.test(u);
+const unhostedLogoSrcs = (srcs) => srcs.filter((s) => /\/vendor-logos\//i.test(s));
+
+function visibleWallpaperHits(html) {
+ const hits = [];
+ const noComments = html.replace(/<!--[\s\S]*?-->/g, '');
+ const altRe = /\balt\s*=\s*(["'])(.*?)\1/gi; let m;
+ while ((m = altRe.exec(noComments)) !== null) if (/\bwallpapers?\b/i.test(m[2])) hits.push(`alt: "${m[2]}"`);
+ const textOnly = noComments.replace(/<[^>]+>/g, ' ');
+ for (const t of (textOnly.match(/\bwallpapers?\b/gi) || [])) hits.push(`visible text: "${t}"`);
+ return hits;
+}
+
+function runChecklist(html) {
+ const results = []; const add = (name, pass, detail) => results.push({ name, pass, detail });
+ add('subject set', !!CAMPAIGN.subject && CAMPAIGN.subject.trim().length > 0, CAMPAIGN.subject);
+ add('from name + email set', !!CAMPAIGN.fromName && !!CAMPAIGN.fromEmail && CAMPAIGN.fromEmail.includes('@'), `${CAMPAIGN.fromName} <${CAMPAIGN.fromEmail}>`);
+ add('reply-to set', !!CAMPAIGN.replyTo && CAMPAIGN.replyTo.includes('@'), CAMPAIGN.replyTo);
+ const addr = CAMPAIGN.physicalAddress || {};
+ const addrComplete = !!(addr.address_line1 && addr.city && addr.state_code && addr.postal_code && addr.country_code);
+ const addrIsPlaceholder = (addr.address_line1 || '').includes(PLACEHOLDER_ADDRESS_MARKER);
+ add('physical address complete', addrComplete, JSON.stringify(addr));
+ add('physical address non-placeholder', addrComplete && !addrIsPlaceholder, addrIsPlaceholder ? 'matches placeholder marker' : 'confirmed non-placeholder');
+ add('html content non-empty', !!html && html.length > 200, `${html.length} bytes`);
+ const bannedHits = visibleWallpaperHits(html);
+ add('no banned word "Wallpaper" (visible copy + alt)', bannedHits.length === 0, bannedHits.length ? `found:\n - ${bannedHits.join('\n - ')}` : 'clean (alt + visible text)');
+ const srcs = extractImageSrcs(html);
+ const nonHttps = srcs.filter((s) => !isAbsoluteHttps(s));
+ add('all image src absolute https', nonHttps.length === 0, nonHttps.length ? `${nonHttps.length}/${srcs.length} not absolute-https` : `${srcs.length}/${srcs.length} absolute-https`);
+ const unhosted = unhostedLogoSrcs(srcs);
+ add('logos hosted at public https (not the un-hosted /vendor-logos/ path)', unhosted.length === 0, unhosted.length ? `${unhosted.length} on un-hosted path` : 'all logos on a confirmed-live host');
+ return results;
+}
+
+function buildPayload(html) {
+ return {
+ name: CAMPAIGN.name,
+ email_campaign_activities: [{
+ format_type: 5,
+ from_name: CAMPAIGN.fromName,
+ from_email: CAMPAIGN.fromEmail,
+ reply_to_email: CAMPAIGN.replyTo,
+ subject: CAMPAIGN.subject,
+ preheader: CAMPAIGN.preheader,
+ html_content: html,
+ physical_address_in_footer: CAMPAIGN.physicalAddress,
+ }],
+ };
+}
+
+async function main() {
+ const html = loadHtml();
+ console.log('='.repeat(72));
+ console.log('New Arrivals Weekly → Constant Contact v3 campaign builder');
+ console.log(`mode: ${CONFIRM ? '--confirm' : '--dry-run (default)'} CC_LIVE=${process.env.CC_LIVE === '1' ? '1' : '(unset)'}`);
+ console.log('='.repeat(72));
+
+ const payload = buildPayload(html);
+ const printable = JSON.parse(JSON.stringify(payload));
+ printable.email_campaign_activities[0].html_content = `<<${html.length} bytes of HTML — truncated>>\n` + html.slice(0, 300) + '\n…';
+ console.log('\n--- CREATE-CAMPAIGN PAYLOAD (html_content truncated) ---');
+ console.log(JSON.stringify(printable, null, 2));
+
+ console.log('\n--- VALIDATION CHECKLIST ---');
+ const results = runChecklist(html); let failed = 0;
+ for (const r of results) { const mark = r.pass ? 'PASS' : 'FAIL'; if (!r.pass) failed++; console.log(` [${mark}] ${r.name}`); if (r.detail) console.log(` ${r.detail}`); }
+ console.log(`\n ${results.length - failed}/${results.length} checks passed, ${failed} failed.`);
+
+ if (DRY_RUN) {
+ console.log('\nDRY-RUN: no network call made. (default)');
+ process.exitCode = failed > 0 ? 2 : 0;
+ return;
+ }
+ if (failed > 0) { console.log('\nREFUSING to create: validation has FAILs.'); process.exitCode = 2; return; }
+ console.log('\n--confirm + validation clean → creating DRAFT (NO-OPs unless CC_LIVE=1):');
+ const activityId = await cc.createCustomCodeCampaign({
+ name: CAMPAIGN.name, subject: CAMPAIGN.subject, preheader: CAMPAIGN.preheader,
+ fromEmail: CAMPAIGN.fromEmail, fromName: CAMPAIGN.fromName, replyTo: CAMPAIGN.replyTo,
+ htmlContent: html, physicalAddress: CAMPAIGN.physicalAddress, confirm: true,
+ });
+ console.log('result:', activityId);
+}
+
+main().catch((e) => { console.error('[build-new-arrivals] ERROR:', e.message); process.exitCode = 1; });
diff --git a/mailers/majilite-metallic-specialties.html b/mailers/majilite-metallic-specialties.html
new file mode 100644
index 00000000..0206d210
--- /dev/null
+++ b/mailers/majilite-metallic-specialties.html
@@ -0,0 +1,71 @@
+<!-- Constant Contact campaign — Majilite Metallic Specialties I (email-safe tables + inline styles) -->
+<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#0d0f12;margin:0;padding:0">
+<tr><td align="center" style="padding:0">
+ <table role="presentation" width="600" cellpadding="0" cellspacing="0" style="max-width:600px;width:100%;background:#14171c;font-family:Helvetica,Arial,sans-serif;color:#e9ecf1">
+
+ <!-- wordmark -->
+ <tr><td align="center" style="padding:22px 24px 8px">
+ <div style="font-size:13px;letter-spacing:.28em;color:#b7bcc2;text-transform:uppercase">Designer Wallcoverings & Fabrics</div>
+ </td></tr>
+
+ <!-- hero -->
+ <tr><td style="padding:0">
+ <img src="https://cdn.shopify.com/s/files/1/0015/4117/7456/files/DWMJ-600158.png" width="600" alt="Majilite Metallic Specialties I" style="display:block;width:100%;height:auto;border:0"/>
+ </td></tr>
+
+ <!-- headline -->
+ <tr><td align="center" style="padding:26px 30px 6px">
+ <div style="font-size:12px;letter-spacing:.22em;color:#5fd08a;text-transform:uppercase;margin-bottom:10px">New Collection · The Nytek® Collection</div>
+ <h1 style="margin:0;font-size:30px;line-height:1.15;font-weight:400;letter-spacing:.01em;color:#ffffff;font-style:italic">Majilite Metallic Specialties I</h1>
+ </td></tr>
+
+ <!-- body -->
+ <tr><td align="center" style="padding:14px 40px 6px">
+ <p style="margin:0;font-size:15px;line-height:1.6;color:#c9ced6">
+ <strong>160 luxurious metallic & neutral finishes</strong> in Majilite's engineered
+ <em>Nytek®</em> faux leather — breathable, remarkably durable (300,000+ double-rubs), and
+ <strong>PFAS-, PVC- & plasticizer-free</strong>. Ideal for wall coverings, seating,
+ flat surfaces & displays.
+ </p>
+ </td></tr>
+
+ <!-- swatch trio -->
+ <tr><td style="padding:22px 30px 6px">
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr>
+ <td width="33%" style="padding:4px"><img src="https://cdn.shopify.com/s/files/1/0015/4117/7456/files/DWMJ-600007.png" width="100%" alt="Reflection Aluminum" style="display:block;width:100%;height:auto;border-radius:6px;border:0"/></td>
+ <td width="33%" style="padding:4px"><img src="https://cdn.shopify.com/s/files/1/0015/4117/7456/files/DWMJ-600120.png" width="100%" alt="Rose Gold" style="display:block;width:100%;height:auto;border-radius:6px;border:0"/></td>
+ <td width="33%" style="padding:4px"><img src="https://cdn.shopify.com/s/files/1/0015/4117/7456/files/DWMJ-600160.png" width="100%" alt="Hammered Metal Midnight" style="display:block;width:100%;height:auto;border-radius:6px;border:0"/></td>
+ </tr></table>
+ </td></tr>
+
+ <!-- CTA -->
+ <tr><td align="center" style="padding:22px 30px 8px">
+ <a href="https://www.designerwallcoverings.com/collections/majilite-metallic-specialties-i"
+ style="display:inline-block;background:#5b6cff;color:#ffffff;text-decoration:none;font-size:15px;font-weight:600;letter-spacing:.02em;padding:14px 34px;border-radius:8px">
+ Shop the Collection →
+ </a>
+ <div style="margin-top:12px;font-size:13px;color:#8a929e">Order any swatch as a <strong style="color:#c9ced6">$4.25 sample</strong>.</div>
+ </td></tr>
+
+ <!-- reassurance line -->
+ <tr><td align="center" style="padding:16px 40px 8px">
+ <div style="font-size:12px;line-height:1.6;color:#8a929e;border-top:1px solid #232830;padding-top:18px">
+ 54" wide · sold by the yard · inherent flame resistance (NFPA-260 Class 1) · made in Massachusetts.<br>
+ Now stocked at Designer Wallcoverings & Fabrics.
+ </div>
+ </td></tr>
+
+ <!-- CAN-SPAM footer: CC injects the account's registered physical address + a working
+ unsubscribe link at send time. Tokens below satisfy the pre-flight gate. -->
+ <tr><td align="center" style="padding:0 40px 26px">
+ <div style="font-size:11px;line-height:1.6;color:#6b7079">
+ Designer Wallcoverings & Fabrics · (888) 373-4564 · DesignerWallcoverings.com<br>
+ [[physical_address]]<br>
+ You received this because you're a Designer Wallcoverings customer or trade contact.
+ <a href="[[UNSUBSCRIBE]]" style="color:#8a929e">Unsubscribe</a> or update your preferences.
+ </div>
+ </td></tr>
+
+ </table>
+</td></tr>
+</table>
← ad27a81d TK-10046: apply-residual reads canonical secrets-manager tok
·
back to Designer Wallcoverings
·
auto-data-snapshot: 2026-08-10T15:07:00 (1 data files) — sho 777d7bb7 →