HI guys
here is the function currently it works only with contact user (contact publisher on item sidebar)
place your api key and listid and you are good to go
place below function in functions.php of theme file and extact zip file and place
MCAPI.class.php file in your active folder
function add_to_mailchimp(){
require_once 'MCAPI.class.php';
// Submit subscriber data to MailChimp
// For parameters doc, refer to:
http://apidocs.mailchimp.com/api/1.3/listsubscribe.func.php$email = $_REQUEST['yourEmail'];
$fname = $_REQUEST['yourName'];
$lname = " ";
$mailchimp_apikey = Params::getParam('apikey');
$mailchimp_listid = Params::getParam('listid');
$api = new MCAPI( $mailchimp_apikey);
$merge_vars = array('FNAME'=>$fname, 'LNAME'=>$lname);
$retval = $api->listSubscribe( $mailchimp_listid, $email,$merge_vars, 'html', false, true );
}
osc_add_hook('pre_item_contact_post','add_to_mailchimp');