=== OperationHQ Lead Capture ===
Contributors: jsrvertex
Tags: crm, leads, contact form 7, wpforms, elementor
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later

Sends every enquiry from your website forms to OperationHQ CRM as a lead, in real time.

== Description ==

Each form submission becomes a lead in OperationHQ › CRM › Leads within seconds — source "Website",
auto-assigned to an owner, with a notification. Repeat enquiries from the same email or phone are added
to the existing lead instead of creating a duplicate.

Supported out of the box:

* Contact Form 7
* WPForms
* Elementor Pro Forms
* Gravity Forms
* Fluent Forms
* Ninja Forms
* Custom theme forms (one line of code, see below)

Fields are recognised automatically (name, first/last name, email, phone, company, service, timeline, message).
Anything else the visitor filled in is added to the lead's message. UTM tags from the landing page
(utm_source, utm_medium, utm_campaign) are sent with the lead.

If OperationHQ cannot be reached, the lead is kept and retried automatically (up to 5 times).

== Installation ==

1. In OperationHQ open CRM › Settings › Website Leads, create a key for your website and copy it.
2. In WordPress go to Plugins › Add New › Upload Plugin, choose operationhq-lead-capture.zip, then Activate.
3. Go to Settings › OperationHQ Leads, paste the key, Save, then click "Test connection".
4. Submit your contact form once — the lead appears in OperationHQ › CRM › Leads.

Prefer keeping the key in wp-config.php? Add this line above "That's all, stop editing!" and leave the field empty:

    define( 'OPERATIONHQ_LEAD_KEY', 'ohq_live_...' );

== Custom theme forms ==

After your form has validated, call:

    do_action( 'operationhq_lead', array(
        'name'    => $name,
        'email'   => $email,
        'phone'   => $phone,
        'company' => $company,
        'message' => $message,
    ), 'Contact form' );

== Changelog ==

= 1.0.0 =
* First release.
