Mailchimp ASP.NET VB列表使用PerceptiveMCAPI订阅分组
发布时间:2020-12-16 10:02:14 所属栏目:asp.Net 来源:网络整理
导读:嗨请有人帮助我在订阅我的邮件列表时对我的客户进行分组……这是我到目前为止,没有GROUPING选项的工作…… Dim newlistSubscribeParms As New listSubscribeParms() newlistSubscribeParms.apikey = "xxx" newlistSubscribeParms.id = "xxx" newlistSubscrib
嗨请有人帮助我在订阅我的邮件列表时对我的客户进行分组……这是我到目前为止,没有GROUPING选项的工作……
Dim newlistSubscribeParms As New listSubscribeParms() newlistSubscribeParms.apikey = "xxx" newlistSubscribeParms.id = "xxx" newlistSubscribeParms.email_address = txtEmailAddress.Text newlistSubscribeParms.double_optin = False newlistSubscribeParms.email_type = EnumValues.emailType.html newlistSubscribeParms.replace_interests = True newlistSubscribeParms.send_welcome = False newlistSubscribeParms.update_existing = True newlistSubscribeParms.merge_vars.Add("FNAME",txtFirstName.Text) newlistSubscribeParms.merge_vars.Add("LNAME",txtLastName.Text) newlistSubscribeParms.merge_vars.Add("GROUPINGS","??") Dim newlistSubscribeInput As New listSubscribeInput(newlistSubscribeParms) Dim subscribeSuccess = cmd.Execute(newlistSubscribeInput) 我在此列表中有一个名为“受众”的主要组,在该组中有4个子组,我希望此代码将客户添加到“报价请求客户”子组… 我使用PerceptiveMCAPI 我查看了文档并一直在搜索,我正努力让任何工作. 谢谢 解决方法
我现在已经解决了这个问题!
看到这段代码,是用C#编写的,希望你能理解它: //from page 12 of "PerceptiveMCAPI Documentation" /* listSubscribe Merge_vars are defined as Dictionary<string,object> where: ? If the string name is Groupings,the object value expected is of type: List<interestGroupings> ? If the object type is DateTime,the value is converted to an acceptable api string equivalent ? if the object type is Dictionary<string,object> (used for address array),the Key¬alue pairs are formated as required ? Any other object type is passed to the api as﹊s. */ //first association of groups for father group "DataGenerazioneContatto" List<string> _groups_for_DataGenerazioneContatto = new List<string>(); _groups_for_DataGenerazioneContatto.Add(DateTime.Now.ToShortDateString()); //today //second association of groups for father group "TipoMail" List<string> _groups_for_TipoMail = new List<string>(); _groups_for_TipoMail.Add("Generica"); //choose ONE or MORE from "Generica" & "Personale" _groups_for_TipoMail.Add("Personale"); List<interestGroupings> _listGroupings = new List<interestGroupings>(); _listGroupings.Add(new interestGroupings { name = "DataGenerazioneContatto",groups = _groups_for_DataGenerazioneContatto }); _listGroupings.Add(new interestGroupings { name = "TipoMail",groups = _groups_for_TipoMail }); listSubscribeParms _listSubscribeParms = new listSubscribeParms(); _listSubscribeParms.apikey = apikey; //your MailChimp apikey _listSubscribeParms.id = _listID; //the ID of the selected MailChimp List _listSubscribeParms.email_address = "emailTest2@from.it"; _listSubscribeParms.double_optin = false; _listSubscribeParms.email_type = EnumValues.emailType.html; _listSubscribeParms.replace_interests = true; _listSubscribeParms.send_welcome = false; _listSubscribeParms.update_existing = true; _listSubscribeParms.merge_vars.Add("FNAME","NameTest2"); _listSubscribeParms.merge_vars.Add("LNAME","SurnameTest2"); _listSubscribeParms.merge_vars.Add("GROUPINGS",_listGroupings); listSubscribe _listSubscribe = new listSubscribe(new listSubscribeInput(_listSubscribeParms)); listSubscribeOutput _listSubscribeOutput = _listSubscribe.Execute(); 在你的情况下(在c#中)它应该是: List<string> _groups_for_Audience = new List<string>(); _groups_for_Audience.Add("Quote Request Customers"); //you can add more than one List<interestGroupings> _listGroupings = new List<interestGroupings>(); _listGroupings.Add(new interestGroupings { name = "Audience",groups = _groups_for_Audience }); newlistSubscribeParms.merge_vars.Add("GROUPINGS",_listGroupings ); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – 将javascript对象作为字典传输到控制器操作
- 我应采取哪些措施来保护我的多层ASP.NET应用程序?
- asp.net – 所有PartialView的自定义ActionResult等效模型
- 用ASP.net检测iPad
- asp.net-mvc-3 – 从Razor _Layout.cshml访问Session对象
- asp.net-mvc – ASP.NET MVC3自定义不显眼的客户端验证不会
- 如何在ASP.NET MVC中执行图像的Ajax / JQuery上载?
- asp.net – 锚标记href中的eval
- Windows Server AppFabric分布式缓存研究
- ASP.NET MVC3(Razor)中的视图中局部变量的简单增量
推荐文章
站长推荐
热点阅读