Home › Forums › Quform WordPress › Mailchimp integration with checkbox
- This topic has 1 reply, 2 voices, and was last updated 9 years ago by Ally.
- AuthorPosts
- February 26, 2015 at 3:12 am #13975csmalexParticipant
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);
March 2, 2015 at 9:20 am #13992AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.