Skip to content

[Clientify] Review why does not sync company custom fields #108

@davidperezgar

Description

@davidperezgar

Currently, the FormsCRM WordPress plugin does not correctly send custom fields when submitting data to Companies in the CRM integration. The issue occurs during form submission, where company custom fields are either not mapped or not included in the API payload.

Expected Behavior

  • Custom fields mapped in the plugin settings should be properly sent to the CRM when creating or updating a Company.
  • The payload should include all custom fields defined by the user.

Actual Behavior

  • Only standard company fields (name, email, phone, etc.) are being sent.
  • Custom fields are ignored or missing in the request body.

Steps to Reproduce

  1. Create or edit a form in WordPress using FormsCRM.
  2. Add custom fields to map to company data.
  3. Submit the form.
  4. Check the CRM to confirm missing custom fields.

Technical Notes

  • Investigate the mapping logic in class-formscrm-api.php and class-formscrm-company-handler.php.
  • Ensure custom_fields or equivalent meta fields are included in the API request.
  • Consider adding a filter or hook (formscrm_before_send_company) to allow developers to modify payload data.

Acceptance Criteria

  • All mapped custom fields are successfully sent to the CRM for Companies.
  • API payload includes custom_fields object when applicable.
  • No regression in contact field submission.

Migration Table (if applicable)

Field Type Description
custom_fields JSON Stores additional company data sent to CRM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions