Home › Forums › Quform WordPress › Active Campaign Custom Fields
- This topic has 4 replies, 2 voices, and was last updated 2 years, 1 month ago by Ally.
- AuthorPosts
- October 10, 2022 at 3:24 pm #34830Dylan ScholtzParticipant
Hi
I have used your guide to add active campaign to work with Quform – https://support.themecatcher.net/quform-wordpress-v2/guides/integration/activecampaign
I got it to work with capturing the basic information, but there are additional fields that I would like to capture from the form to active campaign. I saw another topic (https://support.themecatcher.net/forums/topic/active-campaign-custom-fields-for-quform) about this but I am unsure if that resolved the issue as I could not get it to work.
Code I am currently using through child themes function.php
add_filter(‘quform_post_process_12’, function (array $result, Quform_Form $form) {
$apiUrl = ‘* * * * * * * * *. * *. *’;
$apiKey = ‘* * * * * * * * * * * * * * * * * * * * * * * * ‘;$data = array(
‘contact’ => array(
’email’ => $form->getValue(‘quform_12_1766’),
‘firstName’ => $form->getValue(‘quform_12_1770’)[2],
‘lastName’ => $form->getValue(‘quform_12_1770’)[4],
‘phone’ => $form->getValue(‘quform_12_1765’),
‘fieldValues’ => array(
array(
‘field’ => ‘1’,
‘value’ => ‘Some value’
),
array(
‘field’ => ‘1785’,
‘value’ => $form->getValue(‘quform_12_1785’)
),
)
)
);wp_remote_post($apiUrl . ‘/api/3/contact/sync’, array(
‘headers’ => array(
‘Api-Token’ => $apiKey
),
‘body’ => wp_json_encode($data)
));return $result;
}, 10, 2);October 10, 2022 at 3:41 pm #34831AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 10, 2022 at 4:14 pm #34832Dylan ScholtzParticipantThe response came back as 201 and could not see any issues in the response tab.
October 11, 2022 at 9:46 am #34834Dylan ScholtzParticipantI’ve tried again this morning with the code but had no luck as it still only picks up the basic fullname, lastname, email, phone. There is an additional text field that I want to pull through from the from for the Account Name on Active Campaign.
October 17, 2022 at 10:14 am #34850AllySupport 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.