miguel250 / MZMailChimpBundle

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

Add json_encode on $payload #6

Closed BetterCallJohn closed 12 years ago

BetterCallJohn commented 12 years ago

doc : http://apidocs.mailchimp.com/api/1.3/listsubscribe.func.php

travisbot commented 12 years ago

This pull request passes (merged 9b5f86ef into 3b29bbe6).

miguel250 commented 12 years ago

Hey thx for the pull request but i wont be able to merge. You added json_encode to the global payload which will break the export class. If you like open a new pull request and add json_encode to $payload in https://github.com/miguel250/MZMailChimpBundle/blob/master/Services/Methods/MCList.php#L172

BetterCallJohn commented 12 years ago

When we use "merge_vars" for subscription, there is an error if $payload is not encoded in JSON.

miguel250 commented 12 years ago

Ok so the problem is https://github.com/miguel250/MZMailChimpBundle/blob/master/Services/Methods/MCList.php#L143. Do you have any sample code that i can use to test it?

BetterCallJohn commented 12 years ago

$mailchimp = $this->get('Mailchimp'); $mailchimp->setListID('YOURID'); $list = $mailchimp->getList(); $payload = array('FNAME' => 'CHUCK', 'LNAME' => 'NORRIS'); $list->setMerge($payload); $list->setEmailType('html'); $list->setDoubleOption(false); $list->setUpdateExisting(true); $list->SendWelcome(false);
$list->Subscribe('chuck@norris.com');

error :

Notice: Array to string conversion in /myfullpath/Symfony/vendor/kriswallsmith/buzz/lib/Buzz/Client/AbstractCurl.php line 87

I opened a new pull request with an other solution to fix this.