Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FluentCRM update contact status programatically
<?php
function fcrmUpdateContactStatus($contactEmail, $newStatus) {
$contact = FluentCrmApi('contacts')->getContact($contactEmail);
if($contact) {
$oldStatus = $contact->status;
if($newStatus != $oldStatus) {
$contact->status = $newStatus;
$contact->save();
do_action('fluentcrm_subscriber_status_to_' . $newStatus, $contact, $oldStatus);
}
}
return $contact;
}
// example usage: fcrmUpdateContactStatus('contact@email.com', 'unsubscribed');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment