← back to Designer Wallcoverings
mailers/cc-api/update-houses-we-represent.js
18 lines
const fs = require('fs'); const path = require('path'); const os = require('os');
const cc = require('./cc-client');
const CONFIRM = process.argv.includes('--confirm');
const ACTIVITY_ID = '16f445b7-1df0-49f6-9237-f9584e785668';
const html = fs.readFileSync(path.join(os.homedir(),'Projects/dw-vendor-mailer/mailer.html'),'utf8');
(async () => {
const r = await cc.updateCampaignActivity(ACTIVITY_ID, {
subject: 'New: The Houses We Represent — order any pattern as a sample',
preheader: 'Six ateliers we represent — a few new arrivals from each. Order any pattern as a sample.',
fromName: 'Designer Wallcoverings',
fromEmail: 'steve@designerwallcoverings.com',
replyTo: 'info@designerwallcoverings.com',
htmlContent: html,
physicalAddress: { address_line1:'15442 Ventura Bl', city:'Sherman Oaks', state_code:'CA', postal_code:'91403', country_code:'US' },
}, CONFIRM);
console.log('update result:', r && (r.__mock ? 'MOCK (gate closed)' : 'OK — draft updated in place'));
})().catch(e => { console.error('ERR', e.message); process.exit(1); });