Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafiahmedd/bc49e1aa3fada8844915c28cf91bedae to your computer and use it in GitHub Desktop.
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
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