Open smokinjoe opened 10 years ago
Thanks for taking to the time to look at that. Is it completely working for you now?
here is correct __construct:
$this->ci =& get_instance();
$this->ci->load->config('mailchimp', TRUE);
$this->api_key = $this->ci->config->item('api_key', 'mailchimp');
$this->api_endpoint = $this->ci->config->item('api_endpoint', 'mailchimp');
list(, $datacentre) = explode('-', $this->api_key);
$this->api_endpoint = str_replace('<dc>', $datacentre, $this->api_endpoint);
Great can you submit a pull request? I'll ad it in. If you're not bothered about the ref back I'll just build it in and commit myself.
I'm back using this again!
Also we need to call the function in lowercase like this.
$this->load->library('mailchimp_library');
$lists = $this->mailchimp_library->call('lists/list');
This solved my problem.
For those having issues with this, the problem is rather simple... in the construct there is a line that is actually breaking things. Specifically:
$this->api_endpoint = $this->ci->config->item('api_endpoint', 'mailchimp');
This is overwriting $this->api_endpoint from the value set on the class: private $api_endpoint = 'https://
So by the time you get to $this->api_endpoint = str_replace('
The fix is simply to comment out or remove the line:
$this->api_endpoint = $this->ci->config->item('api_endpoint', 'mailchimp');
Cheers, Jose R. Lopez
I had to change the __construct() in mailchimp_library.php to be: