Mailchimp API doesn't save

Hi ~

I searched the forum and came across a couple of similar topics, but none had a real solution in the comments.

  • my wordpress, php, pro theme, plugins etc are all up to date
  • using a child theme

Per the debug.log, this is the error it’s throwing after I try to save the API key within the Email Forms admin area:

Notice: Undefined index: detail in /home/mrvarchitects/mrvarchitects.com/new/wp-content/plugins/tco-email-forms/email-mailchimp/functions/provider.php on line 157

Here are lines 147 - 165:

//
// Validate the API key
//

function validate_api_key( $key ) {

try {
  $mc_api = $this->make_api_wrapper( $key );
  $result = $mc_api->get('');
  if ( array_key_exists( 'status', $result ) ) {
    throw new Exception( $result['detail'], $result['status'] );
  }
} catch ( Exception $e ) {
  $result = new WP_Error( 'tco-mailchimp', sprintf( __( 'Error while attempting to validate API key: [%s]', '__tco__' ), get_class( $e ) ) );
}

return $result;

}

Specifically, this is line 157:

    throw new Exception( $result['detail'], $result['status'] );

Any insight you can provide would be extremely helpful.

Thanks,

Hello There,

Thanks for writing in! This isn’t an error message. It is only a PHP notice which you can turn off by disabling the debug mode. You can do this by opening wp-config.php and adding


define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

And then make sure that you have set up the mailchimp api and the email forms setting correctly. Please check out this article: https://theme.co/apex/forum/t/extension-email-forms/82

Hope this helps.

Hi @MaceInyerFace,

I noticed that you bumped the thread, please let us know if you have questions related to this.

Thanks!

Hi ~

I thought I had figured it out, but no go.

I wasn’t too clear in my original post, I suppose. “API DOESNT SAVE” means that it won’t save after I plug it into the mailchimp API input field. I hit save and then it flashes - the page comes up blank.

The error message I posted is what i believe is causing the issue. So I was looking for insight into the actual error message, not that it was displaying the error message. I turned on the debug log and messages on purpose.

Hey There,

​To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look?

To do this, you can create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

Thank you.

Thanks for looking into this.

Hey @MaceInyerFace,

I confirm the issue in your site. Your host most probably could not connect to MailChimp server. Please check with your host if cURL is working, and allow_url_fopen is enabled.

If that does not help, please give us FTP access so we could troubleshoot deeper.

Thanks.

The issue ended up being due to Mailchimp. My website is on a shared hosting plan and the IP address was blacklisted by Mailchimp.

Hopefully this tidbit will help someone in the future.

Thanks again for your help,

Thanks for sharing the cause of the issue, @MaceInyerFace. This would surely help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.