Skip to content

Instantly share code, notes, and snippets.

@wapcrazut
Last active February 4, 2019 14:58
Show Gist options
  • Save wapcrazut/81d0fd14b46c299e9d1fd814d55bea1d to your computer and use it in GitHub Desktop.
Save wapcrazut/81d0fd14b46c299e9d1fd814d55bea1d to your computer and use it in GitHub Desktop.
Open MailChimp Newsletter Popup on Button Click
<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