mailchimp-api-php icon indicating copy to clipboard operation
mailchimp-api-php copied to clipboard

How do you use this?

Open ghost opened this issue 6 years ago • 7 comments

Do you have any documentation or sample calls using this wrapper?

ghost avatar Jan 25 '19 04:01 ghost

Add to your readme a couple simple api calls.

bkmorse avatar Feb 21 '19 20:02 bkmorse

Hopefully this isn't a dick move but I've had success with this one and it has examples to get you up and running, hopefully the author of this package will add something similar to their readme.

https://github.com/nztim/mailchimp

bkmorse avatar Feb 22 '19 02:02 bkmorse

I've included the files and tried to create the class, it's just crashes out. require_once( 'mailchimp-api-php/Mailchimp.php' ); $mailchimp = new Mailchimp\Mailchimp( $mailchimp_api_key ); // <- tried it with and without the namespace

Could you provide us with any read-me or working samples to try?

kibblewhite avatar Apr 28 '20 16:04 kibblewhite

I have time this week. I'll make a PR to add examples to the readme.

@kibblewhite do you get any PHP errors or is it not getting that far?

If you replace the require_once line with the following, you should get all the classes loaded:

require 'mailchimp-api-php/vendor/autoload.php';

ruscoe avatar Apr 29 '20 20:04 ruscoe

Two examples added in PR #96

ruscoe avatar Apr 29 '20 22:04 ruscoe

I have time this week. I'll make a PR to add examples to the readme.

@kibblewhite do you get any PHP errors or is it not getting that far?

No errors, just blank when I tried including the Mailchimp.php Thanks, if you are able to get around to it, that would be awesome.

If you replace the require_once line with the following, you should get all the classes loaded:

require 'mailchimp-api-php/vendor/autoload.php';

I'm not able to generate the autoload because of restrictions and accessibility I have on my system. So I was trying to including the files manually. Composer fires off some errors, but that isn't a problem for you to solve. I'll tackle that else where. The error I get from composer is: Root package cannot require itself in its composer.json

The world where we depend on dependencies, rather than just include the file and run with it hey, lol

kibblewhite avatar Apr 30 '20 15:04 kibblewhite

Oh yeah, composer can throw out some really unhelpful errors. Sometimes it's down to the system or composer version. I'm using Composer 1.7.3 if that helps.

If you're just including src/Mailchimp.php, try also including the three files inside src/http. The Mailchimp class relies on them, but they're not manually included because the library relies on Composer to handle it.

That might help.

ruscoe avatar Apr 30 '20 15:04 ruscoe