Home › Forums › Quform WordPress › Multiple Mailchimp Lists 2
- This topic has 2 replies, 2 voices, and was last updated 11 years, 7 months ago by Asiaa.
- AuthorPosts
- April 22, 2013 at 11:17 am #4003AsiaaParticipant
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);
}
April 23, 2013 at 8:20 am #4023AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
April 23, 2013 at 9:15 am #4029AsiaaParticipantThanks Ally,
I’ve been able to resolve this issue.Regards
-Anthony - AuthorPosts
- You must be logged in to reply to this topic.