Mailchimp integration with checkbox

Home Forums Quform WordPress Mailchimp integration with checkbox

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 9 years ago by Ally.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13975
    csmalex
    Participant

    Hi, We have followed your instructions and successfully integrated mailchimp with quform. However, we would like to add a checkbox so that the user can choose to be added or not. We have tried altering your suggested theme function so that if the value of the checkbox is yes, it will continue with adding the user’s email to mailchimp. See below for the modified function. However, when we modify the function in this way it does not work, user emails are no longer added to mailchimp at all. Do you have any suggestions on how to make this work?


    function my_save_to_mailchimp($form){

    if($form->getValue('iphorm_1_7[0]') == "Yes") {
    if (!class_exists('MCAPI')) {
    require_once ('/MCAPI.class.php');
    }

    $api = new MCAPI('xxxxxxxxxxxkey'); $listId = 'xxxxxlistid'; $email = $form->getValue('iphorm_1_2');

    $mergeVars = array(
    'FNAME' => $form->getValue('iphorm_1_1') );
    // Other settings
    $emailType = 'html';
    $doubleOptin = false;
    $updateExisting = false;
    $replaceInterests = false;
    $sendWelcome = true;

    $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome);
    }
    }
    add_action('iphorm_post_process_1', 'my_save_to_mailchimp', 10, 1);

    #13992
    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 2 posts - 1 through 2 (of 2 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