← back to Designer Wallcoverings
Add Houses We Represent CC campaign builder (draft-creates via working cc-client)
dca1d3086c2c26c41eaa260ca0d78d39834e22f7 · 2026-09-09 12:01:07 -0700 · Steve
Files touched
A mailers/cc-api/build-houses-we-represent-campaign.js
Diff
commit dca1d3086c2c26c41eaa260ca0d78d39834e22f7
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Sep 9 12:01:07 2026 -0700
Add Houses We Represent CC campaign builder (draft-creates via working cc-client)
---
.../cc-api/build-houses-we-represent-campaign.js | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/mailers/cc-api/build-houses-we-represent-campaign.js b/mailers/cc-api/build-houses-we-represent-campaign.js
new file mode 100644
index 00000000..138afcc2
--- /dev/null
+++ b/mailers/cc-api/build-houses-we-represent-campaign.js
@@ -0,0 +1,51 @@
+#!/usr/bin/env node
+/**
+ * Build the "Houses We Represent" DRAFT campaign in Constant Contact.
+ * Uses the working cc-client (its own .env creds + rotated token cache).
+ * HTML source lives in the dedicated mailer project (already verified:
+ * 6 vendor rows, 23 product links all 200, Outlook-safe images).
+ *
+ * node build-houses-we-represent-campaign.js # dry-run (default)
+ * CC_LIVE=1 node build-houses-we-represent-campaign.js --confirm # create DRAFT
+ *
+ * Creates a DRAFT only — never schedules/sends (that stays Steve's click).
+ */
+const fs = require('fs');
+const path = require('path');
+const os = require('os');
+const cc = require('./cc-client');
+
+const CONFIRM = process.argv.includes('--confirm');
+const MAILER = path.join(os.homedir(), 'Projects/dw-vendor-mailer/mailer.html');
+
+const CAMPAIGN = {
+ name: `The Houses We Represent — ${new Date().toISOString().slice(0, 16).replace('T', ' ')}`,
+ subject: 'New: The Houses We Represent — order any as a $4.25 sample',
+ preheader: 'Six ateliers we represent — a few new arrivals from each, $4.25 samples.',
+ fromName: 'Designer Wallcoverings',
+ fromEmail: 'steve@designerwallcoverings.com',
+ replyTo: 'info@designerwallcoverings.com',
+ physicalAddress: {
+ address_line1: '15442 Ventura Bl',
+ city: 'Sherman Oaks',
+ state_code: 'CA',
+ postal_code: '91403',
+ country_code: 'US',
+ },
+};
+
+(async () => {
+ const html = fs.readFileSync(MAILER, 'utf8');
+ console.log(`mailer: ${MAILER} (${html.length} bytes)`);
+ console.log(`mode: ${CONFIRM ? '--confirm' : '--dry-run'} CC_LIVE=${process.env.CC_LIVE === '1' ? '1' : '(unset)'}`);
+ console.log(`subject: ${CAMPAIGN.subject}`);
+ 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: CONFIRM,
+ });
+ if (activityId && !activityId.__mock) {
+ console.log('\n✓ DRAFT created — campaign_activity_id:', activityId);
+ console.log(' Review + send from the Constant Contact dashboard (send stays manual).');
+ }
+})().catch((e) => { console.error('ERROR:', e.message); process.exit(1); });
← 6f07975e auto-data-snapshot: 2026-09-09T11:09:48 (1 data files) — pen
·
back to Designer Wallcoverings
·
Add in-place updater for Houses We Represent CC draft a006b5df →