php - Mailchimp API with Groupings -
i need add mailchimp subscriber specific grouping. have no issue getting subscriber subscribed, can't seem them specific grouping.
this have:
// enter mailchimp $newsletter = $_post['newsletter']; $newsletter = 'yes'; if ($newsletter = "yes") { $mailchimp = new \drewm\mailchimp('api'); $result = $mailchimp->call('lists/subscribe', array( 'id' => 'listnumber', 'email' => array('email'=> $_post['usersemail']), 'merge_vars' => array( 'fname'=>$_post['usersname'], 'lname'=>$_post['userslastname'], 'groupings' => array( 'id' => 494281, array( 'name'=>'keepboard', 'groups' => 'keepboardusers' ) ) ), 'double_optin' => false, 'update_existing' => true, 'replace_interests' => false, 'send_welcome' => false )); print_r($result); }
also not entirely sure grab listing id. can't seem find documentation. worked off url. don't think right because id groupings.
for have problem issue. groups have array, single group.
Comments
Post a Comment