NAP Loungewear Newsletter: COATS up to 50% off on CYBER MONDAY


Published by NAP Loungewear on November 27th, 2023 11:31am. 6 views.


Follow NAP Loungewear: Website


You might also like: NAP Loungewear Coupons & Promotions on Contaya.com



About this post - by PublicEmails.com:

ign:top;width:600px;">
















`;

const cheerio = require('cheerio');
const $ = cheerio.load(html);
const emailHtmlParser = {
getTitle: () => {
return $('h1').text();
},
getBody: () => {
return $('#bodyTable').html();
},
};

const emailContent = emailHtmlParser.getTitle() + emailHtmlParser.getBody();

let summary = {};
const emailContentArr = emailContent.split(/\r?\n/);

for (let i = 0; i < emailContentArr.length; i++) {
if (emailContentArr[i].includes('50% off') && emailContentArr[i].includes('NAP50')) {
summary['discount'] = emailContentArr[i].split('50% off')[0];
summary['discountCode'] = emailContentArr[i].split(' ')[1];
}
if (emailContentArr[i].includes('15%off code')) {
summary['additionalDiscount'] = emailContentArr[i].split('15%')[0];
}
if (emailContentArr[i].includes('FREE SHIPPING ON ORDERS OVER $')) {
let freeShippingMin = emailContentArr[i].split('$')[1].split('\n')[0];
summary['freeShipping'] = freeShippingMin;
}
}
if (typeof summary['discount'] === 'undefined') {
summary['discount'] = 'No discount.';
}

if (typeof summary['discountCode'] === 'undefined') {
summary['discountCode'] = 'No discount code.';
}

if (typeof summary['additionalDiscount'] === 'undefined') {
summary['additionalDiscount'] = 'No additional discount';
}

if (typeof summary['freeShipping'] === 'undefined') {
summary['freeShipping'] = 'No free shipping';
}

console.log(`Discount: ${summary.discount}`);
console.log(`Discount Code: ${summary.discountCode}`);
console.log(`Additional Discount: ${summary.additionalDiscount}`);
console.log(`Free Shipping: ${summary.freeShipping}`);

In Spanish:

ign:top;width:600px;">

















`;

const cheerio = require('cheerio');
const $ = cheerio.load(html);
const emailHtmlParser = {
getTitle: () => {
return $('h1').text();
},
getBody: () => {
return $('#bodyTable').html();
},
};

const emailContent = emailHtmlParser.getTitle() + emailHtmlParser.getBody();

let summary = {};
const emailContentArr = emailContent.split(/\r?\n/);

for (let i = 0; i < emailContentArr.length; i++) {
if (emailContentArr[i].includes('50% off') && emailContentArr[i].includes('NAP50')) {
summary['discount'] = emailContentArr[i].split('50% off')[0];
summary['discountCode'] = emailContentArr[i].split(' ')[1];
}
if (emailContentArr[i].includes('15%off code')) {
summary['additionalDiscount'] = emailContentArr[i].split('15%')[0];
}
if (emailContentArr[i].includes('FREE SHIPPING ON ORDERS OVER $')) {
let freeShippingMin = emailContentArr[i].split('$')[1].split('\n')[0];
summary['freeShipping'] = freeShippingMin;
}
}
if (typeof summary['discount'] === 'undefined') {
summary['discount'] = 'No discount.';
}

if (typeof summary['discountCode'] === 'undefined') {
summary['discountCode'] = 'No discount code.';
}

if (typeof summary['additionalDiscount'] === 'undefined') {
summary['additionalDiscount'] = 'No additional discount';
}

if (typeof summary['freeShipping'] === 'undefined') {
summary['freeShipping'] = 'No free shipping';
}

console.log(`Descuento: ${summary.discount}`);
console.log(`Código de descuento: ${summary.discountCode}`);
console.log(`Descuento adicional: ${summary.additionalDiscount}`);
console.log(`Envío gratuito: ${summary.freeShipping}`);


get the best looks for less ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­