A groupings question

75 views
Skip to first unread message

Pamela Selle

unread,
Nov 4, 2010, 12:31:10 PM11/4/10
to MailChimp API Discuss
I'm using the PHP wrapper (listsubscribe), and I'm attempting to pass
form data to the method I'm using within a Drupal module to add
subscriber. Here's the segment from the method:

$groupings = array(
'Subscriptions' => array(
'name' => 'Subscriptions',
'groups' => $subscriptions,
)
);

$merge_vars = array('FNAME'=>$firstName, 'LNAME'=>$lastName,
'GROUPINGS' => $groupings);
// By default this sends a confirmation email - you will not see new
members
// until the link contained in it is clicked!
$retval = $api->listSubscribe($listId, $email, $merge_vars, 'html');

Where $subscriptions is an array of the checked boxes from the form.
The subscribe passes, and I don't get a Mailchimp API error, but the
user isn't added with the appropriate groups.

jesse

unread,
Nov 4, 2010, 12:39:35 PM11/4/10
to MailChimp API Discuss
Your $subscriptions var should not be an array. Take a look at this:
http://groups.google.com/group/mailchimp-api-discuss/browse_thread/thread/d9f2e3124c2a845b/ba66fab3ba584b8d#904378e54350e9f0

We don't throw an error because the array makes it look like you just
didn't pass any groups in.


jesse
Reply all
Reply to author
Forward
0 new messages