CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Matching Non-Email Contacts - Need Advice
Pages: [1]

Author Topic: Matching Non-Email Contacts - Need Advice  (Read 762 times)

chapmanla

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 1
  • CiviCRM version: 4.3.1
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.0.95
  • PHP version: 5.2.5
Matching Non-Email Contacts - Need Advice
December 04, 2010, 11:52:37 am
I am working with a website that has a legacy database where a large percentage of the contacts have not provided email addresses.  We plan to initiate a snail-mail campaign to those contacts to encourage them to submit their email addresses.  I am trying to figure out the simplest way to allow the user to update their contact record online. 

Each contact record has a unique external identifier (member number) that has been imported into the CiviCRM database.   What I would like to do is
  • display a form to the user with member number, last name and email fields,
  • check for a matching record based on the member number and last name
  • if a match is found, insert the submitted email address into the matched contact record


I was hoping to do this via a CiviCRM profile form, and then use a form hook to check for matches and update the email info, but don't think that will work because:
  • the profile would have to be public (since we do not yet know the contact) and I don't want to expose any of the field data to the public
  • even if I was able to properly update the matching record with the new email, I don't think there is a way to prevent CiviCRM from creating a new contact record (I guess there may be a way of automatically deleting the unnecessary contact record after it has been created but this seems clumsy

I am therefore assuming that the only way to do this is to create a non-Civicrm page that performs the above match check/email insert process using API's.  Since someone may have done this before, I would appreciate any input or advice.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Matching Non-Email Contacts - Need Advice
December 09, 2010, 01:26:21 am
Hi,

Probably should work:

Create a profile with the member number and the email, tune the dedupe rule so it matches on the membership number.

Write a validation rule that checks if the contact exists (usin civicrm_contact_get, if it doesn't, reject it ("couldn't find the matching record..."). The risk of that is
a) I mistype my member number and end up modifying someone else record
b) Kevin is going to add different emails to various people (member 10,11,12...). (kids know how to have fun).

I'd suggest improving a bit on that and either generate token for each (enter SUNDRY04) and use it instead of the member number, or at least add a luhn code on the member you send (you'll need to create a custom token.

X+



-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Matching Non-Email Contacts - Need Advice

This forum was archived on 2017-11-26.