使用MailChimp网络挂接功能 [英] Using MailChimp WebHooks feature

查看:155
本文介绍了使用MailChimp网络挂接功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以提供ASP.NET这样的例子。我们希望做一些MailCHimp - 内部数据库的同步,并计划为此使用网络挂接功能,但我们不能得到它的工作。我们要使用网络挂接时,有人从邮件黑猩猩退订进行同步数据。

Can someone please provide examples of doing this in ASP.NET. We want to do some MailCHimp – internal database synchronization and plan to do this using webhooks feature but we just can’t get it work. We want to use web hooks to synch data when someone unsubscribes from mail chimp.

另一件事解决的是安全性。我们如何能够被恶意用户访问安全的页面?

Another thing to address is security. How can we secure this page from being accessed by malicious users?

推荐答案

下面是一块code,它为我们工作的。这是相当简单的,但它并带我们一些尝试得到它的工作。

Here is a piece of code that works for us. This is fairly simple but it did take us some experimenting to get it to work.

        if (Request.Form["type"] != null && Request.Form["type"] == "unsubscribe")
        {

            string email = Request.Form["data[merges][EMAIL]"];
           //now you can do insert/update data in your local database
     }

检查出更多的细节API文档 http://apidocs.mailchimp.com/webhooks/

在安全方面,你可以做一吨的东西,但它取决于你想有多深去。有一件事我建议是检查哪些IP地址/用户代理通过邮件黑猩猩引发网络挂钩,然后就阻止该页面除了这所有其他IP地址的IIS日志和发现。可能有其他的事情可以做,以保证另外像这种使用不容易猜到的网页名称(f3jijselife.aspx远比webhooks.aspx更好)

Regarding security you can do a ton of stuff but it depends on how deep you want to go. One thing I’d recommend is checking your IIS logs and finding which IP address/user agent is used by mail chimp to trigger web hooks and then just block this page for all other IP addresses except for this. There are probably other things you can do to additionally secure this like using page name that is not easily guessed (f3jijselife.aspx is far better than webhooks.aspx)

这篇关于使用MailChimp网络挂接功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆