使用Mailchimp API 3清单时,发送欢迎电子邮件/成员方法 [英] Sending Welcome Email when using Mailchimp API 3 List/Member Method

查看:890
本文介绍了使用Mailchimp API 3清单时,发送欢迎电子邮件/成员方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用Mailchimp API 3列出/会员方法时发送Mailchimp欢迎电子邮件?旧的API实现可以做到这一点,而不需要自动化(付费功能),但我不知道,如果API 3支持它列出/成员方法。我指的是电子邮件,当他们注册使用标准Mailchimp形式,用户通常得到的。

例如,这脚本不会发送欢迎电子邮件或任何其他后注册Mailchimp电子邮件。

  $ apikey ='<&API_KEY GT;';
$ AUTH = base64_en code('用户名:'$ apikey);$数据=阵列(
       apikey'=> $ apikey,
        EMAIL_ADDRESS'=> $电子邮件,
        状态=> '认​​购',
        merge_fields'=>阵列(
        FNAME'=> $名称
            )
);
$ json_data = json_en code($的数据);$ CH = curl_init();
curl_setopt($ CH,CURLOPT_URL,'https://us2.api.mailchimp.com/3.0/lists/<list_id>/members/');
curl_setopt($ CH,CURLOPT_HTTPHEADER,阵列('内容类型:应用程序/ JSON,授权:基本'。$ AUTH));
curl_setopt($ CH,CURLOPT_USERAGENT,PHP-MCAPI / 2.0');
curl_setopt($ CH,CURLOPT_RETURNTRANSFER,真正的);
curl_setopt($ CH,CURLOPT_TIMEOUT,10);
curl_setopt($ CH,CURLOPT_POST,真正的);
curl_setopt($ CH,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ CH,CURLOPT_POSTFIELDS,$ json_data);$结果= curl_exec($ CH);
后续代码var_dump($结果);
死('Mailchimp执行');


解决方案

如果你的打开你的列表中的最后一个欢迎电子邮件当您订阅它应该发送。目前还没有任何办法覆盖列表API v3.0的设置。

Is there a way to send the Mailchimp Welcome Email when using Mailchimp API 3 List/Member method? Older API implementations can do it without the need for Automation (paid feature), but I am not sure if API 3 supports it in List/Member method. I am referring to emails that users usually get when they sign up using a standard Mailchimp form.

For instance, this script will not send a Welcome email or any other post-sign up Mailchimp emails.

$apikey = '<api_key>'; 
$auth = base64_encode( 'user:'.$apikey );

$data = array(
       'apikey'        => $apikey,
        'email_address' => $email,
        'status'        => 'subscribed',
        'merge_fields'  => array(
        'FNAME' => $name
            )
);
$json_data = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://us2.api.mailchimp.com/3.0/lists/<list_id>/members/');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: Basic '.$auth));
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);                                                                                                                  

$result = curl_exec($ch); 
var_dump($result);
die('Mailchimp executed');

解决方案

If you turn on the final welcome email for your list it should send when you subscribe. There's currently no way to override the list setting in API v3.0.

这篇关于使用Mailchimp API 3清单时,发送欢迎电子邮件/成员方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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