Closed vaske closed 11 years ago
Check to make sure you have the config setup properly. Copy the provided sample config to your application/config/mailchimp.php
location and input your API information.
Hmm, I'm getting and error when trying to run the artisan command
php artisan mailchimp::lists
Notice: Undefined offset: 1 in D:\path\to\bundles\mailchimp\libraries\mailchimp.php on line 20
My API key looks correct to me and ends with "-us6"
I am assuming the error is being thrown by:
// determine endpoint
list($ignore, $server) = explode('-', $api_key);
$endpoint = 'https://'.$server.'.api.mailchimp.com/1.3/?method='.self::camelcase($method);
My bundles/mailchimp/config/mailchimp.php reads (api key obscured)
return array(
'api_key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us6',
);```
What is strange I compared MailChimp sample php API what they provide on their website, and that one adds new emails on my account if I try to use it via this implementation, I don't get any error but no new email on my lists on MailChimp.
I place config on right place etc..it's not an issue..
I've just written a pull request to alter mailchimp/libraries/mailchimp.php line 17 to
$api_key = Config::get('mailchimp::mailchimp.api_key');
This has fixed my first error - now to see if subscribers are being added :)
@vaske Are you encountering this error on localhost?
I have tried php artisan mailchimp::lists on localhost and server and it works on server testing env, but not on localhost.
I'm guessing the issue is going to be the same issue I had with Mandrill:
Just added cacert.pem to my mailchimp libraries folder and added
if (Request::env() == 'local')
{
curl_setopt ($ch, CURLOPT_CAINFO, dirname(__FILE__)."/cacert.pem");
}
Now getting true response from list_subscribe.
@alexleonard yes on localhost...I'm still using laravel 3, but plan to upgrade to laravel 4.
@vaske cool - I think if you follow: https://github.com/MichMich/laravel-mandrill/issues/7 and make sure to change Config::get('mailchimp.api_key'.. to Config::get('mailchimp::mailchimp.api_key'... you should be good.
@alexleonard that works thanks and sorry for late response, you may close this one...
The library is written specifically to pull the config from application/config/mailchimp.php
, with you copying the sample config to that location. The reason for this is so updates to the package (git pull origin master
) can be applied w/out messing up your config settings.
Regarding the localhost issue, I run this package fine on my development machine with no problems. I assume this issue is SSL related but not sure what the particular is.
Ahhh, so the idea is to copy the config out of the bundle and into your local config - I totally hadn't twigged that! It's the littlest things that one trips over...!
Guys I did that I copy config under application/config/mailchimp.php and still had that issue until I copy those SSL things...
@vaske I haven't yet worked out how to force curl requests in Windows to not require the cacert.pem file but you can probably bypass it by doing:
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
in library/mailchimp.php
Suddenly I start working when I add those SSL files, Linux worked before now windows as well, hooray!
Brilliant, glad you got it going :) On 26 Jun 2013 18:14, "Milan Vasic" notifications@github.com wrote:
Suddenly I start working when I add those SSL files, Linux worked before now windows as well, hooray!
— Reply to this email directly or view it on GitHubhttps://github.com/swt83/laravel-mailchimp/issues/1#issuecomment-20040186 .
Me to ;)
Do you still support this? I can't manage it to work, constantly getting bool false as a response.