Home › Forums › Quform WordPress › Multiple Forms in MailChimp
This topic is: resolved
- This topic has 3 replies, 2 voices, and was last updated 7 years, 7 months ago by
thibautnorga.
Viewing 4 posts - 1 through 4 (of 4 total)
- AuthorPosts
- January 23, 2018 at 11:56 am #23997
thibautnorga
ParticipantHi guys,
I’ve got 3 forms on my website. They need to go into 2 different lists in MailChimp.
How do I do this?
So form A and B need to go to MailChimp List 1, form C needs to go into MailChimp List 2.
I’ve found some forum posts about the previous php coding, but I’m guessing it has evolved since the change of iphorm into quform.
January 25, 2018 at 2:29 pm #24069Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 26, 2018 at 3:00 pm #24111thibautnorga
ParticipantSo,
I used this, but the site keeps on crashin
<?php /* * Plugin Name: Quform MailChimp Integration * Description: Add subscribers to MailChimp from Quform forms. * Version: 1.0 */ add_filter('quform_post_process_4', function (array $result, Quform_Form $form) { if (!class_exists('MCAPI')) { require_once dirname(__FILE__) . '/MCAPI.class.php'; } $api = new MCAPI('xxx'); $listId = 'xxx'; $email = $form->getValue('quform_4_x'); $mergeVars = array( 'FNAME' => $form->getValue('quform_4_x'), 'LNAME' => $form->getValue('quform_4_x'), 'GENDER' => $form->getValue('quform_4_x'), 'BDAY' => $form->getValue('quform_4_x'), 'COUNTRY' => $form->getValue('quform_4_x'), 'LINGO' => $form->getValue('quform_4_x') ); // Other settings $emailType = 'html'; $doubleOptin = false; $updateExisting = false; $replaceInterests = false; $sendWelcome = false; $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome); return $result; }, 10, 2); add_filter('quform_post_process_2', function (array $result, Quform_Form $form) { if (!class_exists('MCAPI')) { require_once dirname(__FILE__) . '/MCAPI.class.php'; } $api = new MCAPI('xxx'); $listId = 'xxx'; $email = $form->getValue('quform_2_x); $mergeVars = array( 'FNAME' => $form->getValue('quform_2_x'), 'LNAME' => $form->getValue('quform_2_x'), 'EMAIL' => $form->getValue('quform_2_x'), 'GENDER' => $form->getValue('quform_2_x'), 'BDAY' => $form->getValue('quform_2_x'), 'COUNTRY' => $form->getValue('quform_2_x'), 'LINGO' => $form->getValue('quform_2_x') ); // Other settings $emailType = 'html'; $doubleOptin = false; $updateExisting = false; $replaceInterests = false; $sendWelcome = false; $api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome); return $result; }, 10, 2);
January 30, 2018 at 9:17 am #24139thibautnorga
ParticipantSolved, was missing a ‘
- AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.