You’re running a small media company with three dedicated employees. You finished a major project for a huge travel corporation, invoiced them, and now you’re waiting…and waiting for payment.

You’ve sent follow-up emails, you’ve called their accounts department, you’ve filled out their website forms… But, silence.

(function() {

const getFormElements = () => ([
{
type: ‘text’,
name: ‘name’,
label: ‘Name’,
placeholder: ‘Name’,
required: true,
},
{
type: ’email’,
name: ’email’,
label: ‘Email Address’,
placeholder: ‘Email Address’,
required: true,
},
]);

const getFormStates = (successLink) => {
let successMessage=”We have received your submission, thank you for signing up.”;

if (successLink) {
successMessage = successMessage + ‘\Download Here\’;
}

return {
success: {
msg: successMessage,
delay: 0
},
error: {
msg: ‘Please enter a valid email address.’,
delay: 0
}
};
};

const getConfirmAction = (successLink) => ({
name: ‘subscription’,
waitForAsyncResponse: true,
callback: function (event, payload, cb) {
var emailAddress = payload[‘data’][1][‘value’];
// RFC 5322 compliant email regex pattern
const emailRegex = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
var valid = emailRegex.test(emailAddress);
cb(valid);
if (valid && successLink) {
window.open(successLink);
}
}
});

var defaultConfig = {
generic: {
theme: ‘custom’,
colors: {
background: ‘var(–flexi-lytics-bg-color)’,
text: ‘var(–flexi-lytics-fg-color)’,
close: ‘#a6a8c7’,
actionBackground: ‘var(–flexi-lytics-btn-bg-color)’,
actionText: ‘var(–flexi-lytics-btn-text-color)’,
fieldBackground: ‘#fff’
}
},
};

function initializeNewsletterWidget() {
if (typeof jstag === ‘undefined’) {
setTimeout(initializeNewsletterWidget, 100);
return;
}

window.lyticsIters = window.lyticsIters || {};

let lyticsFormID;

jstag.on(“pathfora.publish.done”, function renderNewsletterWidget() {
if (window.lyticsInitialising) {
setTimeout(renderNewsletterWidget, 100);
return;
}

window.lyticsInitialising = true;

const newsletterContainer = document.querySelector(‘.lytics-newsletter-CvwTxdmL’);

const newsletterOnLoad = (event, payload, newsletterName, newsletterLogo, title, ctaType, download) => {
const newsletterLogoEl = newsletterContainer.querySelector(‘.newsletter-logo’);
const widgetText = newsletterContainer.querySelector(‘.pf-widget-text’);

if (!newsletterContainer) return;

if (newsletterLogo !== ” && !newsletterLogoEl) {
newsletterLogo = ‘‘;
newsletterContainer.insertAdjacentHTML(‘afterbegin’, newsletterLogo);
}

if (title !== ”) {
widgetText.querySelector(‘h2’).remove();
title = “

” + title + “”;
widgetText.insertAdjacentHTML(‘afterbegin’, title);
}

const footerText=”Brought to you by”;
const footerOpen = “

“;
const footerClose = “”
let legalText = “

Share.
Leave A Reply