I am trying to get a response from MailChimp to return a message to the subscriber. The subscription works fine, but I do not receive a response from MailChimp. I am Noob in PHP, so I use JSON, or can this be done, as in my code with PHP?
$MailChimp = new \drewm\MailChimp('12122338484487841-us1');
$result = $MailChimp->call('lists/subscribe', array(
'id' => '1123334444',
'email' => array('email'=>$check_mail['customers_email_address']),
'merge_vars' => array('FNAME'=>$check_mail['customers_firstname'], 'LNAME'=>$check_mail['customers_lastname']),
'double_optin' => true,
'update_existing' => false,
'replace_interests' => false,
'send_welcome' => true,
));
if( $result === false ) {
return 'You have already subscribed to the List';
}
else if( isset($result->status) && $result->status == 'error' ) {
}
thanks
source
share