I would like to group my users by "Newsletter", "Users" and "Members" and send emails out via the API, how can I make that possible: http://apidocs.mailchimp.com/api/1.3/index.php
Adding users to groups seem fairly straight forward, but I can't seem to find how to send to them. Neither createCampaign
nor campaignSendNow
has any mentions of groups or how to send to them.
Currently I'm handling this by having 3 seperate lists.
Click the first drop-down menu and choose a group category. Click the second drop-down menu and choose whether to send to contacts who are in one of, all of, or none of the group names. Click the group name you want to send to. Click and hold CMD or CTRL to select more than one group name.
As a best practice, we recommend you maintain only one primary audience in Mailchimp, and use tags and segments to organize and target your contacts. If you have multiple audiences, you can use our combine audiences tool to merge them together.
The Mailchimp Marketing API provides programmatic access to Mailchimp data and functionality, allowing developers to build custom features to do things like sync email activity and campaign analytics with their database, manage audiences and campaigns, and more. To use the Marketing API, you need a Mailchimp account.
You'll need to use the segment_opts
parameter in the campaignCreate() method to select the groups (ie segments) you want to send to.
Using the segment_opts
parameter you can select specific groups. Something like this:
// Assuming your interest group has an ID of 1.
$conditions = array();
$conditions[] = array('field'=>'interests-1', 'op'=>'one', 'value'=>'Newsletter');
$segment_opts = array('match'=>'all', 'conditions'=>$conditions);
$retval = $api->campaignCreate($type, $opts, $content, $segment_opts);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With