Skip to content

Instantly share code, notes, and snippets.

@techjewel
Created February 16, 2021 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techjewel/9a51240852253339ab94df32c0556158 to your computer and use it in GitHub Desktop.
Save techjewel/9a51240852253339ab94df32c0556158 to your computer and use it in GitHub Desktop.
<?php
// add a tag to a current logged in or cookie based contact
// getCurrentContact() method will find the contact from logged in info or from the cookie from email link click
// For more api doc: https://github.com/FluentCRM/fluent-crm/wiki/PHP-API
$contact = FluentCrmApi('contacts')->getCurrentContact();
$tagsToAdd = [1,2];
if($contact) {
$contact->attachTags($tagsToAdd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment