Created
August 23, 2021 09:54
-
-
Save rafiahmedd/bc49e1aa3fada8844915c28cf91bedae to your computer and use it in GitHub Desktop.
Add user to a CRM list base on the inputed number in Fluent Forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('fluentform_submission_inserted', 'addUserToList', 20, 3); | |
function addUserToList($entryId, $formData, $form) | |
{ | |
$contactApi = FluentCrmApi('contacts'); | |
$contact = $contactApi->getContact($formData['id_number']); // Finding the contact from form ID field | |
$list = [3]; // List ID number where you want to assign the user | |
return $contact->attachLists($list); // Adding the contact to a list | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment