dongxiezhi0590 2015-11-23 17:59
浏览 9

用于WP的Mailchimp以编程方式添加订户

i am trying to add an user to a MailChimp list programmatically (so he is a subscriber of any emails i will send). I do have the pro-version of the MailChimp for WordPress plugin.

Is there a way to add - and remove a user (Email and three fields) to a list dynamically? There seems to be an API (http://developer.mc4wp.com/), but i did not found a function to do so.

Is there one?

  • 写回答

2条回答 默认 最新

  • dtrhd2850 2016-07-15 20:08
    关注

    Use the mc4wp_get_api function to grab an instance of the MailChimp for WordPress API. Then call the subscribe() function add an email to a list:

    $list_id = "2341ca4321";
    $email = "subscriber@email.com";
    $api = mc4wp_get_api();
    $api->subscribe($list_id, $email);
    
    • The subscribe() function returns a boolean. This return value simply reports if the subscribe request succeeded. Will return false if the user is already on the list
    • $list_id can be found when logged into MailChimp, looking under a list, Settings > List name and campaign defaults > List ID
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度