How to display the Mailchimp subscribe popup form on click

别等时光非礼了梦想. 提交于 2020-02-06 10:04:10

问题


I am using WordPress. I have to display the Mailchimp subscribe popup on click on the button.

I tried below code but it's not displaying my popup. I checked on google and SO, I found some solution but that is not working.

Would you help me out with this?

<ul><li class="open-popup"><a href="#">Subscribe to our mailing list</a></li></ul>

    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
    <script>
    function showMailingPopUp() {
        //alert("hello");
        require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us20.list-manage.com","uuid":"bd7ed5583d8f567d56a2ed5ec","lid":"007366445e","uniqueMethods":true})})
        document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";                  
    };
    $(function() {
        $(".open-popup a").on('click', function() { 
            showMailingPopUp();
        });
    });
    </script>

Can anyone help me out here?

来源:https://stackoverflow.com/questions/59607025/how-to-display-the-mailchimp-subscribe-popup-form-on-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!