miguel250 / MZMailChimpBundle

[UNMAINTAINED] Symfony2 mailchimp bundle
54 stars 26 forks source link

The getExport() Function dumps the whole list of subscriber #3

Closed idealley closed 12 years ago

idealley commented 12 years ago

Mailchimp allows to select what type of subscribers to select: http://apidocs.mailchimp.com/export/1.0/list.func.php with 3 params: subscribed, unsubscribed, cleaned where the default is subscribed.

It would be good if we could pass a param to get only the unsubscribed (very useful to sync back to a CRM)

additionally, symfony gives me a warning: Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/MAMP/htdocs/symfony2/vendor/bundles/MZ/MailChimpBundle/Services/Methods/MCExport.php line 45

idealley commented 12 years ago

How can I print the raw array right from the controller (type print_r()), just to see what is returned and how it is structured?

miguel250 commented 12 years ago

@Pixarts now you can use

<?php
       $mailChimp = $this->get('MailChimp');
       $export = $mailChimp->getExport();
       $options = array('status' => 'unsubscribed'); //subscribed, unsubscribed, cleaned
       $export->DumpList($options); //return array