Skip to content

Opciones de actualización de contacto#166

Draft
davidperezgar wants to merge 9 commits intotrunkfrom
cursor/opciones-de-actualizaci-n-de-contacto-111f
Draft

Opciones de actualización de contacto#166
davidperezgar wants to merge 9 commits intotrunkfrom
cursor/opciones-de-actualizaci-n-de-contacto-111f

Conversation

@davidperezgar
Copy link
Contributor

Adds a "Contact Update Strategy" option for Clientify forms to prevent duplicate records.

This PR introduces a feed-level setting (fc_crm_update_by) across all form integrations, allowing users to configure whether to search for and update an existing Clientify contact or company by Tax ID, Email, or Phone before creating a new one. This is built on top of the Clientify API v2 migration.


Open in Web Open in Cursor 

cursoragent and others added 9 commits March 3, 2026 15:52
Co-authored-by: David Perez <davidperezgar@gmail.com>
- Update base URL from api.clientify.net/v1 to api-plus.clientify.com/v2
- Update login endpoint from settings/my-account/ to me/
- Update custom fields to use ?object_type= filter parameter
- Update deal creation to use contact_id/company_id instead of URL refs
- Include products inline in deal creation payload (v2 format)
- Add pipeline_id, pipeline_desc, pipeline_stage_desc deal fields
- Add Email Main (type 4) and Phone Main (type 1) from v2 API
- Fix PUT method: use wp_remote_request() instead of wp_remote_post()
- Fix error body access: use wp_remote_retrieve_body() consistently
- Fix pipeline field mismatch (pipeline_desc now maps correctly)
- Update product format to use product_id + price (v2 schema)
- Update test mock data to match v2 response formats
- Add new tests: v2 types, deal fields, contact/deal creation

Closes #163

Co-authored-by: David Perez <davidperezgar@gmail.com>
Co-authored-by: David Perez <davidperezgar@gmail.com>
Co-authored-by: David Perez <davidperezgar@gmail.com>
… Tax ID

- Add formscrm_get_update_by_choices() helper with none/email/phone/tax_id options
- Add search_contact() and extract_update_by_value() private methods to CRMLIB_Clientify
- Update create_entry() to search for existing record before creating when fc_crm_update_by != none
- Uses PATCH to update found records and POST to create new ones
- Add fc_crm_update_by select field to all form integrations: GravityForms, CF7, WPForms, Elementor, WooCommerce
- Add 6 new unit tests covering update/create paths and all three search strategies

Closes #57

Co-authored-by: David Perez <davidperezgar@gmail.com>
@cursor
Copy link

cursor bot commented Mar 4, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants