document.addEventListener('wpcf7mailsent', function(event) {
if (event.detail.contactFormId == 1455) {
var emailInput = event.detail.inputs.find(function(i) { return i.name === 'email'; });
if (emailInput) {
fetch('https://embeds.beehiiv.com/api/v2/subscriptions', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
publication_id: 'pub_184d3257-9b96-4e38-b14b-19c89c2ca2ca',
email: emailInput.value,
utm_source: 'betterleg.com',
utm_medium: 'website',
utm_campaign: 'homepage_signup'
})
});
}
}
}, false);
Please enter your work email to download
Â
Close