首页 > 解决方案 > 如何正确地将 mailchimp 与您的网站集成?

问题描述

我想将 Mailchimp 用于我的网站,该网站在提交时基本上会接收用户的电子邮件,所以我从 mailchimp 获得了 url,如下面的 url,我在最后添加了post-jsonand &c=?

https://xxxxxx.us3.list-manage.com/subscribe/post-json?u=b5d4f5b14088dceec18dc9ca8&id=9d2643cd8e&c=?

并像这样将它与我的 jquery 集成!

$(".mailchimp-submit").submit(function(e){
    e.preventDefault()
    var this_ = $(this)
    var successMsg = "success_message"
    $.ajax({
        type: "GET",
        url:  "url",
        data: this_.serialize(),
        cache       : false,
        dataType    : 'jsonp',
        error       : function(err) {errorMsg()},
        success:(data)=>{
            if (data.result != "success") {
                errorMsg(successMsg)

            } 
            else {
                msg.text()
                msg.css("color","#6610f2")
            }
        },
    })
})

并像这样构建我的表格!

 <form class="mailchimp-submit wow fadeInUp" data-wow-delay="0.6s" method="GET" >
      <div class="input-group subcribes">
          <input type="text" name="EMAIL" class="form-control memail" placeholder="abc@example.com" required>
          <button class="btn btn_submit f_size_15 f_500" type="submit">{% trans 'Get Started' %}</button>
      </div>                              
 </form>

但是我在 FireFox 上提交了我的电子邮件,它在控制台中给了我一个警告:

The resource at “https://xxxxxxx.us3.list-manage.com/subscribe/post-json?u=b…1590645826995&EMAIL=yoneyos382%40whowlft.com&_=1590645826996” was blocked because content blocking is enabled.

我认为浏览器就是这种情况,所以我在 chrome 上尝试了它,但它给了我这样的错误!

A cookie associated with a cross-site resource at https://list-manage.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

但是,当我通过一次单击多次多次提交表单时,它突然给我一条错误消息“此邮件已提交”,然后我检查邮件是否正在发送到 mailchimp!

奇怪的问题吧??是我这边的错误还是MailChimp那边的错误???我该如何解决?

标签: jquerydjangocookiesmailchimp

解决方案


推荐阅读