=== CatCode Leads with Kylas CRM for WooCommerce ===
Contributors: catcodestudio
Tags: kylas, crm, leads, woocommerce, india
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sends WooCommerce customers to Kylas CRM as leads when an order reaches the status you choose, without duplicates.

== Description ==

You sell with WooCommerce and your sales team works in Kylas CRM. This plugin puts every buyer in the CRM, so nobody copies names and phone numbers by hand and no customer is missed.

Kylas is a third-party product. This is an independent integration, not affiliated with or endorsed by Kylas.

= What it does =

* **Customer to lead.** When an order reaches the statuses you choose, the customer goes to Kylas with name, e-mail, phone, company, address and country.
* **No duplicates.** The plugin searches Kylas for the lead by e-mail and phone, or by the one you choose, and uses the lead it finds instead of adding another.
* **What your team typed stays.** An existing lead only gets the fields it lacks, or nothing at all if you prefer.
* **Phone split the way Kylas takes it.** An Indian number 98450 98450 is sent with the country IN, the dial code +91 and the number.
* **Lead source** of your choice for new leads, and a sub-source text, WooCommerce by default.
* **Order note on the order** that tells which lead was created or used.

= Built not to lose a customer =

* Jobs wait in a queue and run one at a time, in the background, so that checkout never waits for the CRM.
* If Kylas does not answer, the job is tried again later. If Kylas asks the plugin to wait, it waits and keeps every job.
* Calls are spaced out.
* The Activity tab shows what is waiting, what failed and why, with a Retry button.
* A staging copy stays quiet. If the site's address changes, sending stops until you confirm that this is the real store, otherwise test orders would reach your sales team as customers.

= What it does not do =

* It does not send anything back from Kylas to the store.
* It does not change or delete leads when an order is cancelled.

// @pro-begin
= Pro =

Sold on [catcode.com.ua](https://catcode.com.ua/modules/kylas-crm-woocommerce/) with a 7-day trial:

* **Order notes.** Each order status you choose is written to the lead as a note with the order number, status, total, payment method and the items bought.
* **Lead stage after a purchase.** The lead moves to the pipeline stage you name.
* **Any lead field**, including your custom ones, filled from the order or from an order meta field.
* **UTM.** Source, campaign, medium, content and term filled from WooCommerce order attribution.
* **Send past orders** in bulk from the orders list.
* **E-mail alerts** when Kylas refuses the API key or an order gives up.

// @pro-end
== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. In Kylas, open Settings > Integrations > API Keys and copy an API key.
3. Open **WooCommerce > Kylas**, paste the key and press Connect. It is kept encrypted with your site's keys.
4. On the **Leads** tab choose the order statuses and the other options.
5. Place a test order and check the lead in Kylas before relying on it.

== Frequently Asked Questions ==

= Does this need a CatCode account? =

No. The plugin talks to Kylas directly, with your own API key.

= Will old orders be sent when I connect? =

No. Only orders placed after connecting are sent automatically. An older one can be sent from its own screen.

= An order was not sent. What now? =

The Activity tab and a note on the order give the reason. Fix it and press Retry.

= Which key should I use? =

The key of an active user who may create and edit leads. The lead is created in that user's name, and the key stops working if the user is deactivated.

= Does it send data for customers who did not consent? =

The plugin sends customers of orders in the statuses you chose. Whether you may do that is decided by your privacy policy and the law that applies to your store. Developers can keep some orders out with the `catcode_kyl_send_order` filter.

== External services ==

This plugin connects to Kylas CRM, a service run by a third party, because sending your customers there is its purpose.

It sends, from your server to the Kylas API (https://api.kylas.io):

* when you connect or press the test button: your API key, to read the name of its user;
* when an order reaches a chosen status, or you press Send: a search for the lead by the customer's e-mail or phone, and, if there is none, the customer's first and last name, e-mail, phone, company, address, city, state, postcode and country, along with the lead source you set.

Nothing is sent before you enter your key. Kylas: [terms of service](https://kylas.io/terms-of-service), [privacy policy](https://kylas.io/privacy).

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
