MailChimp connection not working

Home Forums Quform WordPress MailChimp connection not working

This topic is: resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13820
    freakyleaf
    Participant

    Hey!

    I’ve followed your MailChimp walk-through avidly, and have scoured the forums to try and troubleshoot, but don’t seem to be getting anywhere. The code in my functions.php file look like this:


    function freaky_save_to_mailchimp($form) {
    if (!class_exists('MCAPI')) {
    require_once dirname(__FILE__) . '/inc/php/MCAPI.class.php';
    }

    $api = new MCAPI('[MY MAILCHIMP API KEY]');
    $listId = '[MY LIST ID]';

    $email = $form->getValue('iphorm_1_12');

    $mergeVars = array(
    'FNAME' => $form->getValue('iphorm_1_4'),
    'LNAME' => $form->getValue('iphorm_1_82'),
    'PHONE' => $form->getValue('iphorm_1_6')
    );

    // OTHER SETTINGS
    $emailType = 'html';
    $doubleOptin = false;
    $updateExisting = false;
    $replaceInterests = false;
    $sendWelcome = false;

    $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome);
    }

    add_action('iphorm_post_process_1', 'freaky_save_to_mailchimp', 10, 1);

    My form’s ID is 1, and ‘MCAPI.class.php’ is at ‘wp-content/themes/[THEME NAME]/inc/php/MCAPI.class.php’…

    I’ve tried debug logging (changing the line to ‘$response = $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome);
    iphorm_error_log($response);’), but nothing Quform-wise gets logged (a couple of other unrelated things (other plugins that aren’t being used on the page) do however.

    Was just wondering if I’ve missed anything!

    In short, I’m not receiving error messages of any kind – just nothing seems to go into Mail Chimp!

    Many thanks in advance

    #13833
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #13912
    freakyleaf
    Participant

    Thank you for your reply!

    I added the new code and was able to debug myself… Turns out I was using a dummy email for test submissions (test@test.com), which wasn’t validating, and therefore wasn’t getting sent through… Used a real email address and all worked fine…

    Many thanks for your help…

    #13926
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy