将新订户添加到mailchimp中的列表

时间:2011-11-27 22:33:19

标签: c# asp.net mailchimp

我想知道如何使用asp.net将新订阅者添加到mailchimp列表。

以下是我在该问题中无能为力的代码:

var entry = new Dictionary<string, object>();
entry.Add( "FNAME", "x");
entry.Add( "LNAME", "y" );
var lsi=new listSubscribeInput(apiKey,listId,"xyz@abc.com",entry);
var ls=new listSubscribe(lsi);
ls.Execute();

2 个答案:

答案 0 :(得分:1)

在C#中,实现将是这样的:

        var options = new List.SubscribeOptions{DoubleOptIn = true,EmailType = List.EmailType.Html,SendWelcome = false};
        var merges = new List<List.Merges> { new List.Merges("john@provider.com", List.EmailType.Html) { { "FNAME", "John" }, { "LNAME", "Smith" } } };
        var mcApi = new MCApi(apiKey, false);

        mcApi.ListBatchSubscribe(listId, merges, options);

答案 1 :(得分:0)

此解决方案对我有用。 添加到引用MailChimp.Net.dll 比您可以定义的接口

seasonEpisodePopUpWindow.showAtLocation(anchorView, Gravity.BOTTOM, viewLocation[0], anchorView.getHeight());

您可以在MailChimp列表中添加或更新客户端

IMailChimpManager manager = new MailChimpManager(ConfigurationManager.AppSettings["MailChimpApiKey"].ToString());

希望这对您有帮助...