=== Kapish Email Marketing for WooCommerce ===
Contributors: websolutionsz123
Donate link: https://kapishai.com
Tags: woocommerce, email, marketing, abandoned-cart, automation
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WooCommerce to Kapish for welcome, abandoned cart, browse, post-purchase, and back-in-stock email.

== Description ==

Kapish Email Marketing for WooCommerce connects your store to [Kapish](https://kapishai.com) so you can send lifecycle email from one place: welcome, abandoned cart, browse abandonment, post-purchase, and back in stock.

This plugin is a **connector**. You need a Kapish account. It does not send mail by itself. It is not affiliated with Automattic or WooCommerce.com.

= What it does =

* Registers WooCommerce webhooks for new customers, orders, and product stock changes.
* Adds a storefront tracker that captures email before checkout: a popup, optional [kapish_email] embed, and “Get a restock alert” on sold-out products. Welcome and browse can run even if the shopper never reaches checkout. Cart and browse also include the real product photo, price, and link. No theme or functions.php paste.
* Abandoned-cart and browse emails auto-fill that product. “Others also bought” / recently viewed grids fill at send time.
* Uses the same webhook secret you save in Kapish (HMAC) so deliveries can be verified.
* Declares compatibility with WooCommerce High-Performance Order Storage (HPOS).

= What you still do in Kapish =

Create automations, design emails, and manage contacts in Kapish: Marketing → Email. This plugin only forwards store events.

= Requirements =

* WordPress 6.2 or later
* WooCommerce 8.0 or later
* A Kapish business (copy the business ID from Marketing → Email → Stores)
* HTTPS on your shop if you want WooCommerce to deliver webhooks reliably

== Installation ==

1. In Kapish, open Marketing → Email → Stores. Copy your WordPress business ID (starts with `biz_`) and webhook secret — they appear as soon as you open Stores.
2. In WordPress go to Plugins → Add New, search Kapish Email Marketing for WooCommerce, then Install and Activate. WooCommerce must already be active. You can also upload the plugin folder to `/wp-content/plugins/`.
3. Open WooCommerce → Kapish Email.
4. Paste the Kapish site URL (`https://kapishai.com` unless you host Kapish yourself), business ID, and secret. Confirm Kapish Terms and Privacy, then save. The plugin sends a REST key to Kapish — do not paste ck_/cs_ keys. Welcome, abandoned cart, browse, post-purchase, and back-in-stock turn on in Kapish. The popup and restock form are on by default; add `[kapish_email]` to a page or footer if you want a static signup box.
5. In Kapish, add sending-domain DNS and click Check DNS so mail can send. Turn off overlapping WooCommerce marketing emails so customers are not mailed twice.

== Frequently Asked Questions ==

= Can I list this on WordPress.org without a Kapish account? =

People can install the plugin from WordPress.org, but sending mail requires a Kapish account. The plugin only connects WooCommerce events to Kapish.

= Do I still paste a snippet in my theme? =

No. Never paste into the theme, functions.php, or a page builder HTML block unless you want the optional embed. The plugin shows an email popup, a restock form on out-of-stock products, posts cart/browse events from WooCommerce hooks, and creates webhooks when you save settings. Optional shortcodes: `[kapish_email]` (signup box) and `[kapish_restock]` (restock alert).

= What data is sent to Kapish? =

Customer email and name, order totals and line items WooCommerce already puts on those webhooks, and (from the tracker) the shopper email plus the product name, photo, price, and URL. See the [privacy policy](https://kapishai.com/privacy) and [terms of service](https://kapishai.com/terms).

= Do I agree to Kapish terms when I install the plugin? =

The plugin itself is GPLv2 or later. Sending mail through Kapish is a Kapish service. WooCommerce → Kapish Email asks you to confirm the Kapish [Terms](https://kapishai.com/terms) and [Privacy Policy](https://kapishai.com/privacy) before the store is connected.

= Do I need WooCommerce REST API keys? =

No. From 1.2.0 the plugin creates a Kapish REST key when you install it, then sends that key to Kapish when you save WooCommerce → Kapish Email. You do not paste consumer keys. REST is used to backfill existing customers/orders and to issue unique coupons.

= Which webhooks are created? =

`customer.created`, `order.created`, `order.updated`, and `product.updated`. They all post to your Kapish WordPress hook URL.

= Is this an official WooCommerce.com product? =

No. It is a third-party connector published independently of Automattic / Woo.

== Privacy ==

The plugin sends store events (customer email, order and product data WooCommerce already exposes on those hooks) to the Kapish site URL you configure. See [https://kapishai.com/privacy](https://kapishai.com/privacy) and [https://kapishai.com/terms](https://kapishai.com/terms).

== External services ==

This plugin connects to Kapish (https://kapishai.com) to forward WooCommerce customers, orders, products, cart, and browse events so Kapish can send the emails you set up. A Kapish account is required to send. Data is posted over HTTPS to the site URL you save (default https://kapishai.com).

* Terms of Service: https://kapishai.com/terms
* Privacy Policy: https://kapishai.com/privacy
* Plugin listing: https://kapishai.com/plugins/woocommerce

You confirm those terms in WooCommerce → Kapish Email before webhooks and REST keys are sent.

== Changelog ==

= 1.2.5 =
* Fix critical bug: class-capture.php was missing the opening PHP tag and could dump plugin source on the storefront and wp-admin.

= 1.2.4 =
* Capture email before checkout: popup, [kapish_email] embed, and restock alert on sold-out products so welcome and browse run without reaching checkout.

= 1.2.3 =
* Translations load via WordPress.org automatically; removed manual load_plugin_textdomain().

= 1.2.2 =
* Settings screen links Kapish Terms and Privacy and requires confirmation before connect.

= 1.2.1 =
* Send REST keys on the existing webhook URL so Kapish no longer 404s /connect.

= 1.2.0 =
* Creates a WooCommerce REST API key on install and sends it to Kapish on save. No ck_/cs_ paste.

= 1.1.0 =
* Cart and browse events include the live product photo, price, and URL.
* Server-side WooCommerce hooks so emails still fill if a browser blocks JavaScript.
* No theme, snippet, or functions.php changes required.

= 1.0.0 =
* Initial release: settings screen, WooCommerce webhooks, and storefront tracker.

== Upgrade Notice ==

= 1.2.5 =
Critical fix: update immediately if the site shows PHP source instead of loading. No settings change required.

= 1.2.4 =
Popup and restock alert are on by default. Re-save WooCommerce → Kapish Email if you want to turn them off. Optional shortcode: [kapish_email].

= 1.2.3 =
No action required. Directory translations load automatically.

= 1.2.2 =
Re-save WooCommerce → Kapish Email and confirm Kapish Terms and Privacy.

= 1.2.0 =
The plugin now creates WooCommerce REST keys and sends them to Kapish. Re-save WooCommerce → Kapish Email after updating.

= 1.1.0 =
Abandoned-cart emails now use the real product photo and price. Update the plugin — do not add theme code.

