Multiple Mailchimp Lists 2

Home Forums Quform WordPress Multiple Mailchimp Lists 2

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4003
    Asiaa
    Participant

    Hi, I followed the instructions for integrate mailchimp, that works with my first list but no with the second one. I tried to make changes like Ally explains it here : https://support.themecatcher.net/forums/topic/multiple-mailchimp-lists but It still doesn’t work.
    Thanks for your help,

    Regards,

    -Anthony

    Here my code :


    /*--------------------------------------------------------
    Mailchimp
    --------------------------------------------------------*/

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

    function mytheme_save_to_mailchimp($form)
    {
    require_once dirname(__FILE__) . '/MCAPI.class.php';

    $api = new MCAPI('MY API');
    $listId = 'MY ID LIST 1';
    $email = $form->getValue('iphorm_1_4');
    $mergeVars = array(
    'FNAME' => $form->getValue('iphorm_1_1'),
    'LNAME' => $form->getValue('iphorm_1_2'),
    'NSOCIET' => $form->getValue('iphorm_1_7'),
    'SACTIVITE' => $form->getValue('iphorm_1_23'),
    'SERVCONTAC' => $form->getValue('iphorm_1_11'),
    'CIVILITE' => $form->getValue('iphorm_1_14'),
    'CP' => $form->getValue('iphorm_1_15'),
    'PHONE' => $form->getValue('iphorm_1_3'),
    'INSNEWS' => $form->getValue('iphorm_1_20'),
    'TYPE' => $form->getValue('iphorm_1_8'),
    );

    // 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_2', 'mytheme_save_to_mailchimp_2', 10, 1);

    function mytheme_save_to_mailchimp_2($form)
    {
    require_once dirname(__FILE__) . '/MCAPI.class.php';

    $api = new MCAPI('MY API');
    $listId = 'MY ID LIST 2';
    $email = $form->getValue('iphorm_2_8');
    $mergeVars = array(
    'NFIRM' => $form->getValue('iphorm_2_1'),
    'FJURIDIC' => $form->getValue('iphorm_2_4'),
    'ACTIVITE' => $form->getValue('iphorm_2_2'),
    'ADD' => $form->getValue('iphorm_2_3'),
    'CP' => $form->getValue('iphorm_2_23'),
    'VILLE' => $form->getValue('iphorm_2_21'),
    'PAYS' => $form->getValue('iphorm_2_24'),
    'NOM' => $form->getValue('iphorm_2_12'),
    'PRENOM' => $form->getValue('iphorm_2_13'),
    'SWEB' => $form->getValue('iphorm_2_7'),
    );

    // Other settings
    $emailType = 'html';
    $doubleOptin = false;
    $updateExisting = false;
    $replaceInterests = false;
    $sendWelcome = false;

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

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

    #4029
    Asiaa
    Participant

    Thanks Ally,
    I’ve been able to resolve this issue.

    Regards
    -Anthony

Viewing 3 posts - 1 through 3 (of 3 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