To Create contact please use this API: https://developers.fluentcrm.com/global-functions/contact-api-function/
$contactApi = FluentCrmApi('contacts');/*
* Update/Insert a contact
* You can create or update a contact in a single call
*/
$data = [
'first_name' => 'Jhon',
'last_name' => 'Doe',
'email' => '[email protected]', // requied
'status' => 'pending',
'tags' => [1,2,3, 'Dynamic Tag'], // tag ids/slugs/title as an array
'lists' => [4, 'Dynamic List'] // list ids/slugs/title as an array,
'detach_tags' => [6, 'another_tag'] // tag ids/slugs/title as an array,
'detach_lists' => [10, 'list_slug'] // list ids/slugs/title as an array,
'custom_values' => [
'custom_field_slug_1' => 'custom_field_value_1',
'custom_field_slug_2' => 'custom_field_value_2',
]
];
$contact = $contactApi->createOrUpdate($data);
// send a double opt-in email if the status is pending
if($contact && $contact->status == 'pending') {
$contact->sendDoubleOptinEmail();
}
