=== Sprintplan Form Sync for Pipedrive ===
Contributors: wpsprintplan
Tags: pipedrive, crm, contact-form-7, wpforms, fluent-forms, formidable-forms, integration, leads, contacts
Requires at least: 5.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync form submissions from Contact Form 7, WP Forms, Fluent Forms, and Formidable Forms to Pipedrive CRM automatically.

== Description ==

**Sprintplan Form Sync for Pipedrive** connects your WordPress forms directly to Pipedrive CRM. No more manual data entry — every form submission is automatically synced to the right Pipedrive module.

This is an independent, third-party plugin and is not affiliated with, endorsed by, or officially connected to Pipedrive. The name "Pipedrive" is a trademark of Pipedrive OÜ.

= Supported Form Plugins =

* **Contact Form 7** - Most popular WordPress contact form plugin
* **WP Forms** - Drag & drop form builder for WordPress
* **Fluent Forms** - Fastest WordPress form builder with smart features
* **Formidable Forms** - Advanced form builder with calculation capabilities

= Supported Pipedrive Modules =

* **Persons/Contacts** - Create and update contact records
* **Organizations** - Manage company accounts
* **Deals** - Track sales opportunities with automatic value formatting
* **Leads** - Capture potential customers with person association
* **Activities** - Log calls, meetings, tasks, and deadlines
* **Notes** - Attach notes to deals, persons, or organizations
* **Products** - Manage your product catalog

= Key Features =

* **Visual Field Mapping** - Easy interface to map form fields to Pipedrive fields
* **Module-level Sync Control** - Enable/disable sync for each Pipedrive module independently
* **Smart Data Normalization** - Automatic formatting for phones, emails, deal values, and dates
* **Sync Activity Log** - Track all sync operations with success/failure status
* **Leads with Person Creation** - Automatically create persons when adding leads

== Installation ==

= From WordPress.org =

1. Go to **Plugins > Add New** in your WordPress admin
2. Search for "Sprintplan Form Sync for Pipedrive"
3. Click **Install Now** then **Activate**

= Manual Installation =

1. Download the plugin zip file
2. Go to **Plugins > Add New > Upload Plugin**
3. Upload the zip file and click **Install Now**
4. Activate the plugin

= Configuration =

1. Go to **Sprintplan Pipedrive > Settings**
2. Enter your **Pipedrive API Token** (found in Pipedrive → Settings → Personal Preferences → API)
3. Go to the **Synch Settings** tab and enable sync for the desired modules
4. Go to **Field Mappings** to map your form fields to Pipedrive fields
5. Save your settings and test a form submission

== Frequently Asked Questions ==

= Where do I find my Pipedrive API token? =

Log in to your Pipedrive account, go to **Settings > Personal Preferences > API**, and copy your API token.

= Can I map one form to multiple Pipedrive modules? =

Yes! You can map a single form submission to create a Person, a Deal, and an Activity simultaneously.

= What happens if Pipedrive is down? =

The sync activity log will show the failure with the error message returned by Pipedrive.

= Does it support custom fields in Pipedrive? =

Yes, all your custom fields in Pipedrive will appear in the field mapping dropdown.

= Is my data secure? =

All data is transmitted securely via HTTPS to Pipedrive's REST API. Your API token is stored in your WordPress database as a plugin option.

== External Services ==

This plugin connects to the Pipedrive REST API (https://api.pipedrive.com/v1) to create and manage CRM records.

**What data is sent and when:**

* **API authentication check**: When you save your API token on the Settings page, the plugin sends a request to `GET /users/me` to verify the connection. No user data is sent.
* **Field definitions**: When you set up field mappings, the plugin fetches available field definitions from the Pipedrive API (e.g. `GET /personFields`). No user data is sent.
* **Form submission sync**: When a visitor submits a mapped WordPress form, the field values you have mapped are sent to the Pipedrive API to create a record (e.g. a Person or a Deal). Only the fields you have explicitly mapped are transmitted.

This service is provided by Pipedrive OÜ:

* Terms of Service: https://www.pipedrive.com/en/terms-of-service
* Privacy Policy: https://www.pipedrive.com/en/privacy

== Screenshots ==

1. **Settings Page** - Configure API token and module sync settings
2. **Field Mapping** - Visual interface for mapping form fields to Pipedrive
3. **Sync Activity Log** - View all sync operations with status and details

== Changelog ==

= 1.0.1 =
* Renamed plugin to "Sprintplan Form Sync for Pipedrive" to clarify third-party status
* Replaced all cURL calls with WordPress HTTP API (wp_remote_get/post)
* Improved input sanitization for sync settings
* Renamed generic AJAX action hooks to use wpspi_ prefix
* Removed redundant load_plugin_textdomain() call
* Added external services disclosure to readme

= 1.0.0 - Initial Release =
* First release
* Support for Contact Form 7, WP Forms, Fluent Forms, and Formidable Forms
* Support for Pipedrive Persons, Organizations, Deals, Leads, Activities, Notes, and Products
* Visual field mapping interface
* Sync activity logging
* Module-level sync controls

== Upgrade Notice ==

= 1.0.1 =
Plugin renamed for trademark compliance. All functionality is unchanged.

== Arbitrary section ==

= Hook Reference =

Developers can extend the plugin using these hooks:

* `wpspi_before_create_record` - Modify data before sending to Pipedrive
* `wpspi_after_record_created` - Run custom code after successful sync
* `wpspi_wp_modules` - Add support for additional form plugins
* `wpspi_verify_ssl` - Override SSL verification (default: true)
* `wpspi_normalize_module_data` - Customize data normalization per module
