I am not able to subscribe multiple emails in MailChimp. Using API https://bitbucket.org/mailchimp/mailchimp-api-php/downloads
$api_key = "***";
$list_id = "***";
require ('api/Mailchimp.php');
$Mailchimp = new Mailchimp($api_key);
$Mailchimp_Lists = new Mailchimp_Lists($Mailchimp);
$batch[] = array('email' => '[email protected]');
$batch[] = array('email' => '[email protected]');
$subscriber = $Mailchimp_Lists -> batchSubscribe($list_id, $batch, false, false, true);
I am getting following Error:
[errors] => Array
(
[0] => Array
(
[code] => -99
[error] => An email address must contain a single @
[email] => [email protected]
)
[0] => Array
(
[code] => -99
[error] => An email address must contain a single @
[email] => [email protected]
)
)
Email should be a struct, not a string.
$batch[] = array('email' => '[email protected]');
$batch[] = array('email' => '[email protected]');
Should be
$batch[] = array('email' => array('email' => '[email protected]'));
$batch[] = array('email' => array('email' => '[email protected]'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With