UPDATE
added this to the JS file data: {action: 'mailchimp_submit', 'EMAIL': email},
and it now sends email notification saying you are subscribed. But it doe not add the emails to the list in MailChimp.
This is the function now
add_action('wp_ajax_mailchimp_submit', 'mailchimp_submit');
add_action('wp_ajax_nopriv_mailchimp_submit', 'mailchimp_submit');
function mailchimp_submit() {
require_once __DIR__.'/inc/MCAPI.class.php';
$listId = '38e7d0812f';
$api = new MCAPI('9100a95dd06efdbf58ec87bab613cee8-us5');
$subscriberemailID = $_POST["EMAIL"];
$retval = $api->listSubscribe( $listId, $subscriberemailID, $merge_vars = null );
}
Not sure why the emails are not added to the list in MailChimp but the confirmation emails are being sent out. Any suggestions????