Mailchimp Intergration Code Not working

Home Forums Quform WordPress Mailchimp Intergration Code Not working

This topic is: resolved
  • This topic has 10 replies, 2 voices, and was last updated 7 years ago by Ally.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #26807
    rnipper
    Participant
    <?php
    /*
    
     * Plugin Name: Quform MailChimp Integration
    
     * Description: Add subscribers to MailChimp from Quform forms.
    
     * Version: 1.0
    
     */
    
     
    
    add_filter('quform_post_process_2', function (array $result, Quform_Form $form) {
    
        if (!class_exists('MCAPI')) {
    
            require_once dirname(__FILE__) . '/MCAPI.class.php';
    
        }
    
    	
    
        $api = new MCAPI('*SNIP*');
    
        $listId = '*SNIP';
    
        $email = $form->getValue('quform_2_4');
    
    	$mergeVars = array(
    		/*'PHONE' => $form->getValue('quform_2_7')*/
    	);
    
        // Set the first and last name (optional)
    
        $fullname = $form->getValue('quform_2_3');
    
    	$name = explode(" ", $fullname);
    
        $mergeVars['FNAME'] = $name[0];
    
        $mergeVars['LNAME'] = $name[1];
    
     
    
        // Other settings
    
        $emailType = 'html';
    
        $doubleOptin = false;
    
        $updateExisting = false;
    
        $replaceInterests = false;
    
        $sendWelcome = true;
    
     
    
        $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome);
    
     
    
        return $result;
    
    }, 10, 2);

    I have used this on multiple sites and it was working before August and now it just stopped working when setting up a new list.

    • This topic was modified 7 years ago by Ally. Reason: Removed API key
    #26830
    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.

    #26842
    rnipper
    Participant

    I am using QuForm V2 and already added the true statement and still didn’t work.

    #26844
    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.

    #26845
    rnipper
    Participant

    Email has been sent with the information.

    #26857
    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.

    #26858
    rnipper
    Participant

    Thanks that worked…what it is the difference between 10,1 and 10,2? Everything I looked up when doing this always had 10,2

    #26859
    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.

    #26860
    rnipper
    Participant

    So I do not know if this is a caching or what but I copy and pasted the working code from the dev site to the live site and it isn’t accepting it anymore. Does it have to do with https?

    #26864
    rnipper
    Participant

    It is working now! It might of been that my happy little self didn’t realize it wasn’t activated on the live site. Thanks for the assistance! Greatly appreciate you taking a look at it!

    #26866
    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 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy