Skip to content

jaapjansma/de.systopia.xcm

 
 

Repository files navigation

Extended Contact Matcher (XCM)

Creates an API action Contact.getorcreate that will return a contact Id for the input parameters. First a search is done for the given contact (see settings in Installation section below), and if that's not conclusive a new contact will be created.

Only the contact id is returned.

The settings page offers lots of options such as:

  • determining how contacts are matched.
  • recording an activity when contacts are created/updated
  • adding contacts to groups or adding a tag.

Installation

Install in the usual way. Then go to AdministerAdminstration ConsoleXtended Contact Matcher Settings (/civicrm/admin/setting/xcm) to visit the settings panel.

At the very least you need to visit that settings page and add a rule, or the extension will always create new contacts.

Usage

Let's say this person is not in your database:

<?php
$result = civicrm_api3('Contact', 'getorcreate', array(
  'first_name' => "Wilma",
  'last_name' => "Flintstone",
  'email' => "[email protected]",
));
// $result['id'] = 1234

They are now. Do the same thing again:

<?php
$result = civicrm_api3('Contact', 'getorcreate', array(
  'first_name' => "Wilma",
  'last_name' => "Flintstone",
  'email' => "[email protected]",
));
// $result['id'] = 1234

They were found and no duplicate contact was created.

About

CiviCRM Extended Contact Matcher

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 87.4%
  • JavaScript 6.4%
  • Smarty 6.2%