=== Leadflow Connector ===
Contributors: mbarbieri
Tags: leads, crm, flamingo, contact form 7, lead management
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: flamingo
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connects your site to Leadflow: the Contact Form 7 messages saved by Flamingo become new leads to call in Leadflow.

== Description ==

Leadflow Connector connects your WordPress site to your company in [Leadflow](https://leadflow.deskpilotapp.cloud/), the CRM that follows each contact from the first request to the appointment and the signed contract.

Every 5 minutes Leadflow reads the messages that Flamingo saved from your Contact Form 7 forms and turns them into new leads, ready in the call queue:

* first name, last name, email, phone, province, course and message are read from the form fields;
* the lead source is chosen in Leadflow, even a different one for contacts coming from Google Ads;
* no duplicates: a contact already in Leadflow only gets the new request in its history;
* spam marked by Flamingo is never shared;
* nothing runs on your site: no WordPress cron and nothing sent by the site on its own. Leadflow asks for the new messages with signed requests.

You need a Leadflow account (the administrator of your company creates the connection key) and the free [Flamingo](https://wordpress.org/plugins/flamingo/) plugin, which saves the Contact Form 7 messages in the database.

The plugin interface is available in English and Italian.

== External services ==

This plugin connects to **Leadflow** (https://leadflow.deskpilotapp.cloud/), an external CRM service, to turn your form messages into leads. Nothing is sent or read before an administrator pastes the connection key created in Leadflow and clicks "Connect".

* **When you connect the site** (Settings › Leadflow › Connect), the plugin sends to Leadflow the site address, the REST address of the plugin, the versions of WordPress, PHP, Leadflow Connector, Flamingo and Contact Form 7, and the ID of the last Flamingo message (when you choose "New ones only").
* **Every 5 minutes, after the connection**, Leadflow calls the REST route `leadflow/v1/messaggi` of your site with a signed request (HMAC-SHA256) and receives the Flamingo messages saved after the last one it read: date, subject, sender name and email, page address and the form fields. Messages marked as spam are never returned.
* **When you disconnect the site**, the plugin tells Leadflow that the connection has been removed.

Leadflow privacy policy: https://leadflow.deskpilotapp.cloud/privacy
Leadflow terms of use: https://leadflow.deskpilotapp.cloud/termini

== Installation ==

1. Install and activate **Flamingo** (and Contact Form 7, if it is not already on the site).
2. Install **Leadflow Connector** from Plugins › Add New, searching for "Leadflow Connector", and activate it.
3. In Leadflow open Utility › Connettori › WordPress, click "Collega un sito" (Connect a site), choose the lead source and copy the connection key. The key is shown only once.
4. In WordPress open Settings › Leadflow, paste the key, choose "New ones only" or "All" and click "Connect".

Within 5 minutes Leadflow starts reading the messages. The settings page shows the company, the last check by Leadflow and how many messages are still to be read.

== Frequently Asked Questions ==

= Do I need a Leadflow account? =

Yes. The connection key is created by the administrator of your company in Leadflow, under Utility › Connettori › WordPress.

= Does it work without Flamingo? =

No. Contact Form 7 does not save the messages: Flamingo does, and Leadflow reads them from Flamingo.

= Are the old messages imported too? =

Only if you choose "All" when you connect the site. With "New ones only" Leadflow reads the messages arriving from that moment on.

= Will the same person become two leads? =

No. A contact already in Leadflow (same phone or email) only gets the new request in its history.

= Does the plugin slow down my site? =

No. The plugin does not schedule anything and does not send anything by itself: Leadflow asks for the new messages every 5 minutes through a signed REST request.

= What happens when I disconnect or uninstall the plugin? =

New messages no longer reach Leadflow. Leads already received stay in Leadflow and the messages stay in Flamingo. Uninstalling the plugin removes its settings.

== Screenshots ==

1. Settings › Leadflow before the connection: paste the key created in Leadflow and choose which messages to read.
2. Settings › Leadflow with the site connected: company, site name in Leadflow, last check and messages still to be read.
3. In Leadflow (Utility › Connettori › WordPress): the connected site with the leads received, the lead source and the versions.

== Changelog ==

= 1.1.0 =
* English base language with the Italian translation included.
* Links to the Leadflow privacy policy and terms of use on the settings page.
* Requires WordPress 6.5 (dependency on Flamingo declared with Requires Plugins).

= 1.0.0 =
* First version: every 5 minutes Leadflow reads the Flamingo messages and turns them into leads.

== Upgrade Notice ==

= 1.1.0 =
English base language with Italian translation, links to privacy policy and terms of use.
