Home › Forums › Quform WordPress › MailChimp connection not working
- This topic has 3 replies, 2 voices, and was last updated 9 years, 2 months ago by Ally.
- AuthorPosts
- February 9, 2015 at 11:12 pm #13820freakyleafParticipant
Hey!
I’ve followed your MailChimp walk-through avidly, and have scoured the forums to try and troubleshoot, but don’t seem to be getting anywhere. The code in my functions.php file look like this:
function freaky_save_to_mailchimp($form) {
if (!class_exists('MCAPI')) {
require_once dirname(__FILE__) . '/inc/php/MCAPI.class.php';
}$api = new MCAPI('[MY MAILCHIMP API KEY]');
$listId = '[MY LIST ID]';$email = $form->getValue('iphorm_1_12');
$mergeVars = array(
'FNAME' => $form->getValue('iphorm_1_4'),
'LNAME' => $form->getValue('iphorm_1_82'),
'PHONE' => $form->getValue('iphorm_1_6')
);// 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_1', 'freaky_save_to_mailchimp', 10, 1);
My form’s ID is 1, and ‘MCAPI.class.php’ is at ‘wp-content/themes/[THEME NAME]/inc/php/MCAPI.class.php’…
I’ve tried debug logging (changing the line to ‘$response = $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome);
iphorm_error_log($response);’), but nothing Quform-wise gets logged (a couple of other unrelated things (other plugins that aren’t being used on the page) do however.Was just wondering if I’ve missed anything!
In short, I’m not receiving error messages of any kind – just nothing seems to go into Mail Chimp!
Many thanks in advance
February 11, 2015 at 1:04 pm #13833AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 17, 2015 at 1:56 pm #13912freakyleafParticipantThank you for your reply!
I added the new code and was able to debug myself… Turns out I was using a dummy email for test submissions (test@test.com), which wasn’t validating, and therefore wasn’t getting sent through… Used a real email address and all worked fine…
Many thanks for your help…
February 18, 2015 at 11:07 am #13926AllySupport 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.