First off as always thanks in advance. I'm no expert when it comes to php so I appreciate the help.
What I'm trying to do:
Send data from my form to Mailchimp api. Specifically email, name and birthday.
What it currently does:
Sends email and name
What it wont do:
Send the birthday
I know I'm doing something stupid here and that it is a simple fix but I just can work it out!
The simple guide to the function I'm using from the api is here > http://apidocs.mailchimp.com/api/1.3...cribe.func.php
As you can see it prefers to have the birthday in the MM/DD format.
$month = $_POST['Month'];
$year = $_POST['Year'];
//Create Birthday in mm/dd format for mailchimp
$birthday = $month."/".$day;
I then use the function to send the data (which as I mentioned above works for everything APART from the birthday!
function SubscribeToList($listId, $name, $email)
$api = new MCAPI($apiKey);
$parsedName = ParseName($name);
$mergeVars = array('FNAME' => $parsedName['first'], 'LNAME' => $parsedName['last'], 'birthday'=>"$birthday");
$success = $api->listSubscribe($listId, $email, $mergeVars, 'html', false);
I get the feeling this is me using the wrong syntax, but I've been trying to get this to work for about two days!
What am I doing wrong here?