Add contacts to ActiveCampaign list

Home Forums Quform WordPress Add contacts to ActiveCampaign list

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #30984
    artwstudio
    Participant

    Hey I’m using this code to add contacts in AC;

    ` add_filter(‘quform_post_process_2’, function (array $result, Quform_Form $form) {
    $apiUrl = ‘https://mariowow98.api-us1.com’;
    $apiKey = ‘api_key’;
    $data = array(
    ‘contact’ => array(
    ’email’ => $form->getValue(‘quform_2_369’),
    ‘firstName’ => $form->getValue(‘quform_2_371’)[2],
    ‘lastName’ => $form->getValue(‘quform_2_371’)[4],
    ‘phone’ => $form->getValue(‘quform_2_372’),
    )
    );

    wp_remote_post($apiUrl . ‘/api/3/contacts’, array(
    ‘headers’ => array(
    ‘Api-Token’ => $apiKey
    ),
    ‘body’ => wp_json_encode($data)
    ));

    return $result;
    }, 10, 2); `

    I need to add contacts to a specifically list, how can i do?

    Thanks themecatcher

    • This topic was modified 3 months, 3 weeks ago by artwstudio.
    • This topic was modified 3 months, 3 weeks ago by Ally. Reason: removed private info
    #30990
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #30998
    artwstudio
    Participant

    Okay, thank you very much.
    I’ll wait for the code

    #31015
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31018
    artwstudio
    Participant

    The code works well! Thanks u so much!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy