i'm trying to add a new user to my list on mailchimp (email, first name and last name). But i've could not, any help would be apreciated.
my variables:
$email = test_input($_POST["email"]);
$name = test_input($_POST["name"]);
$arr = explode(' ',trim($nombre));
included Mailchimp api v2.0
include('Path/to/Mailchimp.php');
$api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxx";
$list_id = "xxxxxxxxxx";
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
then, after some steps i try to subscribe a new user to my list:
try {
$subscriber = $Mailchimp_Lists->subscribe( $list_id, array( 'email' => $email));
} catch (Exception $e) {
}
but, when i try to change to:
$subscriber = $Mailchimp_Lists->subscribe( $list_id, array( 'email' => $email, 'FNAME'=>'Test', 'LNAME'=>'Account' ));
Nothing happens.