Last active
February 4, 2019 14:58
-
-
Save wapcrazut/81d0fd14b46c299e9d1fd814d55bea1d to your computer and use it in GitHub Desktop.
Open MailChimp Newsletter Popup on Button Click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script> | |
<script type="text/javascript"> | |
function showNewsletter() { | |
// Replace with YOUR list values | |
require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"YOUR-BASEURL","uuid":"YOUR-UUID","lid":"YOUR-LID"}) }); | |
// Disable MCPopupClosed cookie for being able to re-open the popup | |
document.cookie = "MCPopupClosed=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC"; | |
// Disable MCPopupSubscribed cookie for being able to re-open the popup once suscribed | |
document.cookie = "MCPopupSubscribed=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC"; | |
} | |
</script> | |
<button type="button" onclick="showNewsletter()">Newsletter</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment