=== RadarSend ===
Contributors: radarsend
Tags: crm, woocommerce, email marketing, contacts, analytics
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 3.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync contacts, track visitor activity and automate lifecycle stages with RadarSend. Adds WooCommerce order and subscription events.

== Description ==

RadarSend connects your WordPress site to your RadarSend account so that the
people who register, buy, or subscribe on your site become contacts you can
segment and email.

**This plugin requires a RadarSend account.** It is the client for a paid
third-party service; without an account it has nothing to connect to. See the
External Services section below for exactly what data is sent and when.

= What it does =

* Syncs WordPress users to RadarSend contacts on registration and login
* Keeps a durable link between each WordPress user and their RadarSend contact,
  so changing an email address moves the existing contact rather than creating a
  second one
* Optionally injects RadarSend's tracking script to record page views and
  attribute them to a known contact
* Records login and signup events
* Renders forms built in RadarSend, via a block or the `[radarsend_form]` shortcode

= With WooCommerce =

* Purchase, refund, and payment-failure events
* Subscription activation, renewal, cancellation, and expiry events
  (requires WooCommerce Subscriptions)
* Product-based tagging rules
* Lifecycle stage mapping per subscription state
* Customer billing details and order totals synced to the contact record

WooCommerce is optional. Without it, the plugin syncs users and tracks activity.

== External Services ==

This plugin connects to RadarSend, a third-party contact management and email
service: https://www.radarsend.com

**It transmits personal data to that service.** RadarSend is operated by the
same authors as this plugin. You must have a RadarSend account, and you are
responsible for having a lawful basis to send your users' data to it.

Nothing is sent until an administrator connects the site to a RadarSend
account from the plugin's settings screen. Before that, the plugin makes no
external requests at all.

= Endpoints contacted =

* `https://app.radarsend.com/oauth/authorize` — only when an administrator
  clicks Connect. Opens RadarSend's authorization screen in the browser.
* `https://mcp.radarsend.com/oauth/register`, `/oauth/token` — exchanges and
  refreshes the OAuth credentials that authorize this site. Sends your site URL.
* `https://mcp.radarsend.com/wordpress/*` — the API used for all contact and
  event syncing described below.
* The tracking script URL supplied by your RadarSend account — loaded in
  visitors' browsers only when tracking is enabled.
* `https://mcp.radarsend.com/wordpress/api/forms` and `.../forms/{id}/embed` —
  the list of your forms and their rendered markup, fetched when you place a
  form and when the block editor loads.
* The forms script from your RadarSend tracking domain — loaded in visitors'
  browsers only on pages that contain a RadarSend form.

= Data sent, and when =

* **On user registration and login:** email address, first and last name,
  WordPress user ID, and username.
* **On a WooCommerce order or subscription change:** billing name, email,
  phone, company, address, city, state, country, order totals, product names,
  and subscription status. Only if you set them up: the order and subscription
  fields you map on the Field mapping tab (such as lifetime value, order count
  and last order date), and the tags from your tagging rules.
* **On an email address change:** the old and new addresses, so the existing
  contact can be moved instead of duplicated.
* **From visitors' browsers, when tracking is enabled:** each page view (the
  page address, title and referrer, the visitor's screen and window size and
  time zone, and whether the browser is automated); time on page, how far the
  visitor scrolls, and when they first interact with the page; whether the
  visit came from a link in a RadarSend email; with WooCommerce, each product
  added to the cart (product ID and name, price, quantity and currency); and
  the email address of a logged-in user (or of a guest, on their order
  confirmation page), used to attribute their activity to their contact. As
  with any web request, RadarSend also receives the visitor's IP address and
  browser user agent. RadarSend's tracking script sets its own cookies for
  this, and holds them back until consent when your RadarSend account
  requires it.
* **When a visitor submits a RadarSend form:** whatever that form collects —
  typically name, email address and any consent choices. These submissions go
  **directly from the visitor's browser to RadarSend** and are not received,
  stored or processed by your WordPress site. Which fields a form collects is
  decided in RadarSend, not here.

Tracking can be turned off in the plugin settings, in which case no script is
loaded and nothing is sent from visitors' browsers.

By using this plugin you agree to RadarSend's terms and privacy policy:

* Terms of Service: https://radarsend.com/legal/terms/
* Privacy Policy: https://radarsend.com/legal/privacy/

== Installation ==

1. Install and activate the plugin.
2. Go to **RadarSend** in the admin menu.
3. Click **Connect** and authorize the site against your RadarSend account.
4. Complete the setup wizard to choose tracking and lifecycle stage settings.

Existing users can be synced in bulk from **RadarSend → Sync Users**.

== Frequently Asked Questions ==

= Do I need a RadarSend account? =

Yes. This plugin is a client for the RadarSend service and does nothing without
an account. You connect by clicking Connect and authorizing the site; there is
no API key to copy or paste.

= Do I need WooCommerce? =

No. WooCommerce adds order, subscription, and product-tagging features, but the
plugin syncs users and tracks activity without it.

= What happens when a user changes their email address? =

The plugin moves the existing RadarSend contact to the new address, so the
person keeps their history and subscription state instead of becoming a second,
empty contact. If another contact already holds the new address, the plugin
flags the pair for you to merge in RadarSend rather than guessing which record
to keep. Pending merges are listed under **RadarSend → Debug**.

= Can I stop it tracking visitors? =

Yes. Turn off tracking in the plugin settings. No script is loaded and no
browser-side data is sent.

= Does it bundle Action Scheduler? =

Yes. Background jobs run through Action Scheduler so no API call blocks a page
load. If another plugin (such as WooCommerce) also includes it, only the newest
copy is used — the copies do not conflict.

Action Scheduler is developed by Automattic and licensed under the GPLv3
(https://github.com/woocommerce/action-scheduler). Its files are included
unmodified in `vendor/woocommerce/action-scheduler`.

= How do I customize the data sent? =

Three filters are available: `radarsend_contact_data` (contact fields before an
upsert), `radarsend_event_properties` (event properties), and `radarsend_external_id` (the
external identifier used per WordPress user).

== Changelog ==

= 3.1.5 =
* Initial release on WordPress.org.
