我正在尝试更新 Aweber 订阅者信息,特别是自定义字段,并且我正在使用 Aweber API,但它不起作用,可能我没有正确编写代码:
require_once('../AweberAPI/aweber_api/aweber_api.php');
include("../config.php");
$email=$_POST["email"];
$threefears=$_POST["3fears"];
$handlefears=$_POST["handlefears"];
$threeactions=$_POST["3actions"];
$changelife=$_POST["changelife"];
$consumerKey = '';
$consumerSecret = '';
$accessKey = '***'; # put your credentials here
$accessSecret = '***'; # put your credentials here
$account_id = ''; # put the Account ID here
$list_id = ''; # put the List ID here
$aweber = new AWeberAPI($consumerKey, $consumerSecret);
try {
$custom_field->name = 'Favorite Color';
$custom_field->save();
$params = array('email' => '$email');
$found_subscribers = $account->findSubscribers($params);
foreach($found_subscribers as $subscriber) {
$subscriber->custom_fields = array(
'Top 3 biggest fears related to dating' => '$threefears',
'How would the person you most admire handle these fears' => '$handlefears',
'What are 3 actions you can take today to act more like the person you most admire' => '$threeactions',
'How will taking these actions change your attitude towards dating and your life' => '$changelife',
);
$subscriber->save();
}
}