=== Hive Mail ===
Contributors: hiveplugins
Tags: email marketing, newsletter, email automation, woocommerce, crm
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Email marketing, newsletters and automation for WordPress and WooCommerce. Unlimited contacts and emails, all kept in your own site.

== Description ==

**Hive Mail is a self-hosted email marketing plugin for WordPress.** Build your audience, send newsletters and campaigns, and automate follow-up emails without leaving your dashboard. Your contacts, campaigns and statistics live in your own WordPress database, and there are no limits on contacts, emails or automations.

✅ Collect subscribers with signup forms, or connect the forms you already use
✅ Send and schedule campaigns with a visual email builder
✅ Automate welcome series, follow-ups and abandoned-cart reminders
✅ Keep every contact, tag and list organised, with segments built from rules
✅ See who opened, who clicked and what revenue each email brought in
✅ Send through your host, any SMTP plugin, Mailgun or SendGrid
✅ Double opt-in, unsubscribe and preference pages, and bounce handling included
✅ Free, unlimited, and no telemetry

👉 [Documentation](https://hiveplugins.com/docs) | [Hive Mail website](https://hiveplugins.com/hivemail/)

= Why Hive Mail? =

Email marketing services charge by the contact and keep your list on their servers. Hive Mail runs inside WordPress: the data stays with you, there is no monthly fee for growing your list, and your emails go out through the mail setup you already trust. It is built for small businesses, bloggers, agencies and WooCommerce and Easy Digital Downloads stores that want one place for their audience, their emails and their results.

= Grow your audience =

* **Signup forms** you build in minutes and place with a shortcode or a block, with a live preview, optional consent box, double opt-in and spam protection (a hidden honeypot, a time check, rate limits and an optional CAPTCHA: Cloudflare Turnstile, hCaptcha or Google reCAPTCHA).
* **Connect the forms you already have.** A guided page connects Fluent Forms, WPForms, Contact Form 7, Gravity Forms or Elementor forms, matches their fields for you and adds each new person to the right list.
* **Import** from a CSV file, your WordPress users, WooCommerce and Easy Digital Downloads customers, or from Mail Mint and FluentCRM; export to CSV whenever you like.

= Organise your contacts =

* Contacts with lists, tags, custom fields and a timeline of everything that happened to them.
* Segments you build from rules (country, tag, list, activity, purchases and more) with a live count.
* Clear statuses (subscribed, pending, unsubscribed, bounced, complained) and a do-not-email memory that keeps people who opted out from being added back by mistake.

= Design and send campaigns =

* **Four email editors**: a Visual drag-and-drop builder, a Classic editor, Plain text, and your own HTML. Starter templates, a brand kit, a version history and test sends.
* Personalise with merge tags, test two subject lines (A/B), add UTM tags, and schedule in your site's timezone.
* A **campaign report** for every send: opens, clicks, the links people clicked, unsubscribes, bounces, and the orders that followed.

= Automate follow-up =

* A **visual automation canvas** with triggers, emails, delays, conditions, splits, tags, lists, fields and webhooks.
* **Automation recipes**: ready-made flows (welcome series, abandoned cart, re-engagement and more) that you can switch on and change.
* Start flows from a signup, a form plugin, a WordPress event, a shop order or an incoming webhook, and see a run log for every contact.

= WooCommerce and Easy Digital Downloads =

* Customers with order totals, a checkout sign-up box, and **abandoned-cart recovery** for WooCommerce.
* Triggers for new orders, first purchases, refunds and downloads, and revenue shown next to each campaign and flow.

= Marketing intelligence (optional, off until you switch it on) =

* A small first-party visitor tracker: **Live** visitors, **Pages**, **Traffic Sources**, **Conversions** with goals, visitor **journeys** on each contact and an engagement score.
* An anonymous mode that sets no cookie, an optional consent banner you can restyle, and it follows the consent tool you already use. Nothing is ever sent to another server.

= Deliverability, privacy and compliance tools =

* Double opt-in with a confirmation email, an unsubscribe page, a preference centre, `List-Unsubscribe` headers, a suppression list and bounce handling for Mailgun, SendGrid and any service that can call a webhook.
* A readiness checklist and a guide to scheduled sending, so you know your site is set up to send.
* WordPress privacy tools (export and erase a person's data) and suggested privacy-policy text. Hive Mail gives you the tools; you remain responsible for how you use them.

= A small credit in your emails =

Hive Mail can add a small line, "Powered by Hive Mail", that links to https://hiveplugins.com/hivemail/, to the bottom of your marketing emails. It is off by default. It appears only if you switch it on yourself in Settings → Compliance → Email footer, and it is never shown on your website.

= Free, unlimited and private =

* **Unlimited** contacts, emails and automations: nothing is locked behind a license key.
* **No telemetry.** Hive Mail does not contact Hive Plugins or any other server by itself.
* **Self-contained.** Every script and style the plugin uses ships with it.

Hive Mail Pro is a separate add-on and is not required.

== Installation ==

1. Upload the `hivemail` folder to `/wp-content/plugins/`, or install the plugin from the Plugins screen.
2. Activate the plugin. Three pages (Unsubscribe, Email preferences and Subscription confirmed) are created for you.
3. Open **Hive Mail** in the admin menu and follow the first steps on the Dashboard: set your From address, choose how emails are sent, send a test, and add your first list.

Hive Mail requires PHP 8.0 or newer and WordPress 6.4 or newer.

== Frequently Asked Questions ==

= Does Hive Mail send email itself? =

Hive Mail queues messages and sends them through WordPress (`wp_mail`), so it works with any SMTP plugin or mail service you already use. You can also send through the Mailgun or SendGrid API. How many emails you can send per hour depends on your host or sending service; Settings > Sending lets you set a speed that suits it.

= Is there a limit on contacts, emails or automations? =

No. There are no quotas and nothing is locked behind a license key. How many emails you can send depends on your mail server or sending service.

= Do I need WooCommerce or Easy Digital Downloads? =

No. Hive Mail works on any WordPress site. The shop screens, triggers and reports appear only when one of them is active.

= Can I move over from Mail Mint or FluentCRM? =

Yes. Hive Mail > Import / Export can read their contacts, lists, tags and custom fields from your database and bring them in. Nothing in the other plugin is changed.

= How do scheduled campaigns and automations run? =

Hive Mail runs a small worker every minute through WordPress's scheduler. A site with little traffic may need a real server cron job so that it ticks on time; Settings > Scheduler shows the state and the exact command or address to use.

= I already use a form plugin. Do I have to rebuild my forms? =

No. Open Hive Mail > Forms and choose "Connect a form". Hive Mail lists the forms of Fluent Forms, WPForms, Contact Form 7, Gravity Forms or Elementor, matches the fields, and creates an automation that adds each new person to your list. Your form is not changed.

= Which cookie-consent tools does the visitor tracker work with? =

If your site already has a cookie banner, Hive Mail shows no banner of its own and follows that tool's choice about statistics. It reads the choice through the WP Consent API, and directly for CookieYes, Complianz, Cookiebot and iubenda. Settings > Tracking & Privacy shows what was found.

= Is visitor tracking on by default? =

No. It is off until you switch it on under Hive Mail > Settings > Tracking & Privacy. It can run without any cookie (anonymous mode), it can wait for consent (through Hive Mail's optional banner, your own, or the WP Consent API), and it respects Do Not Track and Global Privacy Control by default. Whether visitors must agree first depends on the mode and on where they live: full mode needs consent in the EU, the UK and similar regimes. You remain responsible for your privacy policy and for following the law where you operate; this is information, not legal advice.

= Does it phone home? =

No. Hive Mail makes no requests to external servers by itself. It only contacts an email service if you choose that service as your delivery method and enter its key, and a CAPTCHA service if you set one up for a signup form (see External services). There is no telemetry, no licence check and no remote code or assets.

= What personal data does Hive Mail store? =

Hive Mail stores the contact data you add to it in your WordPress database. Email open and click tracking is configurable under Hive Mail > Settings > Tracking & Privacy (full, anonymous or off). When you delete the plugin, your data is removed only if you enable "Delete all Hive Mail data when the plugin is deleted" in Settings > General.

If you build a flow that starts from a form plugin (Fluent Forms, WPForms, Contact Form 7, Gravity Forms, Elementor forms), from a WordPress event or from the incoming webhook, the details a visitor submits (the email address, the name and the fields you map) are stored as a contact in your database, and the submission is kept with the person's run of the flow for 30 days after it finishes. Passwords and captcha answers are never kept. Nothing is created from a form until a flow that uses it is switched on. The incoming webhook only accepts requests that carry the flow's own address, and optionally a signature made with its secret.

= What does Hive Mail keep about WooCommerce and Easy Digital Downloads customers? =

With WooCommerce active, Hive Mail keeps a summary of each customer's paid orders (how many, the total, the first and last order, the products and categories bought) in your database, read from WooCommerce. It adds an email sign-up box to the checkout (never ticked in advance; it can be switched off under Hive Mail > Settings > WooCommerce); a customer who ticks it is subscribed, and the time, the wording of the box and the order are recorded as their permission. For abandoned-cart reminders it keeps the carts of logged-in customers and, once a guest types their email address at checkout, that guest's cart and address: a small script on the checkout page sends the address to your own site when the field is left (nothing goes to any other server). A guest who did not tick the sign-up box is never emailed, and a guest who ticked it on a cart they did not order is asked to confirm by email first (this can be switched off under Hive Mail > Settings > WooCommerce). Carts are deleted after 90 days (configurable), and tracking can be limited to logged-in customers or switched off.

With Easy Digital Downloads active, Hive Mail keeps the same kind of summary of each customer's purchases (how many, the total, the first and last purchase, the downloads and download categories bought) in your database, read from Easy Digital Downloads. It adds an email sign-up box to the checkout (never ticked in advance; it can be switched off under Hive Mail > Settings > Easy Digital Downloads); a customer who ticks it is subscribed, and the time, the wording of the box and the order are recorded as their permission. While the order is being made, the tick is remembered for an hour in your database, against a hash of the customer's address, and then forgotten. Hive Mail does not track carts for Easy Digital Downloads.

When a shop order is paid, Hive Mail checks whether the customer clicked one of your emails (a campaign or a flow email) in the 7 days before it. If so, it keeps the order's number, amount and currency with that email in your database, linked to the contact, so the reports can show which emails were followed by a sale. Nothing about this is sent anywhere.

= How do the two visitor-tracking modes differ? =

**Visitor tracking is off until you switch it on** (Hive Mail > Settings > Tracking & Privacy > Visitors on your site). When it is on, a small script (`assets/js/hivemail-track.js`) sends the pages people visit, the site, search engine or campaign that brought them (the referrer and the UTM tags of the address), the type of device (desktop, tablet or mobile, read from the browser's user agent) and, if you enable them, clicks on links to other sites, downloads and your own custom events, to your own site (`?hivemail=t`). They are stored in your database only, never sent to another server. There are two modes:

* **Anonymous**: no cookie is set and no IP address is stored. To count visitors, Hive Mail makes a code from the visitor's IP address and browser with a random value that is kept only for the current day and then deleted (so it is not stored beyond that day, and earlier days' codes cannot be worked out again, not even with your site's secret keys). A visitor is therefore counted for one day only and cannot be followed from one day to the next, and is never linked to a contact.
* **Full**: a first-party cookie, `hm_vid` (on the other sites of a multisite network `hm_vid_` and the site's number, so each site has its own), holds a random number for 13 months (set by your server, only for your site, not readable by scripts, never extended), so visits on different days are linked; only a hash of it is stored. You choose whether to wait for consent: then nothing is sent and the cookie is not set until Hive Mail's optional banner (below) or your own banner calls `HiveMail.consent(true)`, or the WP Consent API plugin reports consent to statistics. `HiveMail.forget()`, or withdrawing consent, deletes the cookie and erases the visits recorded with it.

Everything is stored in your WordPress database, in tables beginning `hm_`: a code or hash that stands for each browser, its visits and the steps in them (deleted after 90 days by default; you can set 7 to 365), and daily totals, which are only numbers. The full list of what is stored and for how long is in the Frequently Asked Questions above ("What does visitor tracking store, and for how long?").

= How does the consent banner work? =

**Consent banner (optional, off by default).** In full mode with "Wait for consent", Hive Mail can show a small card in a bottom corner with Accept and Decline, styled under Settings > Tracking & Privacy > Banner design. It names what is recorded and why, loads nothing from elsewhere and blocks nothing on your site. The answer is kept only in the visitor's browser (local storage key `hivemail_consent`, with its date; no cookie): a refusal for 6 months, an agreement for 12. Decline records nothing and erases what was recorded for that browser; a "Privacy choices" button lets visitors change their mind. It covers Hive Mail's tracking only, not other scripts, and is not shown when another cookie-consent tool is on the site: Hive Mail then follows that tool's choice about statistics, through the WP Consent API or directly for Complianz, CookieYes, Cookiebot and iubenda. It is a convenience, not legal advice.

= How does Hive Mail link a visitor to a contact? =

In full mode, a visitor's browser is linked to their contact when they click a link in one of your emails that leads to your site, send a form, log in or place an order. Their earlier visits then belong to the contact too, and a line saying how they were recognised is added to the contact's timeline. How this works, step by step, is in the FAQ ("How does Hive Mail link a visitor to a contact?").

= Who is never tracked? =

Browsers that send "Do Not Track" or Global Privacy Control are not tracked (a setting, on by default). Administrators (or the roles you choose), the addresses you exclude, the order confirmation pages and, unless you switch it off, the login, sign-up, account and password-reset pages (WordPress's own, and the customer account, pay-for-order and purchase-history pages of WooCommerce and Easy Digital Downloads) are never tracked; we suggest excluding membership and profile pages too, as their addresses can hold a person's name or an order number. `HiveMail.forget()` erases a browser's visits even when it sends one of those signals. Requests are limited per browser and per network. The IP address is used only for that limit and the anonymous daily code, and is never stored as such. Behind a proxy or CDN, the visitor's address is read from the `X-Forwarded-For` header only when the request comes from an address listed under "Trusted proxies" (by default only the server itself), so a visitor cannot pick their own. You are responsible for your privacy policy; Hive Mail suggests text for the mode you chose under Settings > Privacy.

= What is the engagement score, and who can see visitor data? =

Recognised contacts also earn engagement points from visits (full mode only): 1 for each day on which they visited, 1 for viewing a product or download page and 1 for viewing one of the pages you list under "Pages that show buying interest" (each at most once a day), and 10 for each paid order, in addition to the points for opening and clicking emails. To give each point once, Hive Mail keeps a small record of what has been earned (the contact, the kind, and the day or the order number): the day records for 3 days, the order records for 180 days.

Who sees it: the Live view, Pages, Traffic Sources, Conversions, Visitors & Journeys and the journey on a contact's profile are shown only to people with the Hive Mail capability to view intelligence (administrators by default), inside your WordPress admin.

= What does visitor tracking store, and for how long? =

Only if you switch visitor tracking on (it is off by default). All of it is in your WordPress database, in tables beginning `hm_`:

* **Visitors**: the code or hash that stands for a browser, its device type, when it was first and last seen, the source it first came from, whether permission was recorded, and the contact it was recognised as (full mode only). Deleted when not seen for 13 months; an anonymous-mode visitor goes with the day's detail, after the days you set below.
* **Visits and visit details**: for each visit, its times, its first and last page, its source, medium and campaign, the name of the referring site (never the full address) and its number of pages; and for each step, the page, the time and what happened: a page view, a click on another site's link (its address without the query), a download, one of your custom events, a product viewed, added to the cart, taken to the checkout or bought (the order number, total and currency), or a form sent (which form, never what was typed). Deleted after 90 days by default (you can set 7 to 365 days). Ad click codes in an address (such as `gclid`) are used to name the source and are not stored. Browsers that look like robots are not recorded.
* **Daily totals** (page views, visitors, visits, events, goals reached and order amounts, per day, per page and per source): kept, because they are numbers and contain nothing about any one person. They are what the reports show for longer periods. A day keeps at most 20,000 pages and 20,000 sources by name; anything beyond that (for example when someone floods your site with made-up addresses) is added up as "other". The list of page addresses (without query strings) and titles is kept too, because the daily totals refer to it; the title of a published post or page is taken from WordPress, any other page's from the browser. Someone who may change Hive Mail's settings can forget a page from its screen under Pages: its address, its title, every visit step on it and its own daily totals are deleted.
* **Short-lived technical records**: two counters that limit how often one browser, and one network (one IP address, or one block of IPv6 addresses), can send (keyed hashes of the IP address and browser, and of the network, which change every day; kept for a few minutes, in memory when your site has a persistent object cache); the daily random value of anonymous mode (the current day's only); and, while an order is being placed, a note of which visitor placed it (kept 30 days), so the purchase is recorded in that visit when a payment service confirms it later.
* **Goals** you define (an order, a form or a page) are saved as a setting.

= Can I export or erase a person's data? =

The WordPress tools under Tools > Export Personal Data and Erase Personal Data include "Hive Mail site visits": the devices, visits and pages recorded for the contact with that email address, how a browser was recognised as theirs (the lines about it on the contact's timeline) and the record of engagement points their visits earned (the eraser removes all of it and keeps the contact). Deleting a contact for good, by hand or when the trash is emptied after 30 days, deletes them as well.

== External services ==

Hive Mail does not connect to any external service by default: emails are handed to WordPress (`wp_mail()`, and whatever SMTP plugin your site uses).

If you choose **Mailgun** under Hive Mail > Settings > Sending, Hive Mail sends each email to the Mailgun API (https://api.mailgun.net, or https://api.eu.mailgun.net for the EU region) at the moment it is sent. The data sent is the email itself: the recipient's address, the sender, the subject, the message body and its headers, authenticated with your Mailgun API key. Mailgun's terms: https://www.mailgun.com/legal/terms/ and privacy policy: https://www.mailgun.com/legal/privacy-policy/.

If you choose **SendGrid**, Hive Mail sends each email to the SendGrid API (https://api.sendgrid.com) in the same way, authenticated with your SendGrid API key. SendGrid's terms: https://www.twilio.com/en-us/legal/tos and privacy notice: https://www.twilio.com/en-us/legal/privacy.

If you add a CAPTCHA to a signup form (Hive Mail > Settings > Forms; off until you set it up), the form uses **Cloudflare Turnstile**, **hCaptcha** or **Google reCAPTCHA**, whichever you choose. On a page showing such a form, the visitor's browser loads that service's script from its server, so it receives the visitor's IP address, browser and device details and the page address, and may set cookies or storage on its own domain to tell a person from a robot. When the form is sent, your site sends the service your secret key, the check's token and the visitor's IP address, and it answers yes or no; nothing typed in the form is sent, and the answer is not stored. Other pages send nothing. Terms and privacy: https://www.cloudflare.com/website-terms/, https://www.cloudflare.com/privacypolicy/, https://www.hcaptcha.com/terms, https://www.hcaptcha.com/privacy, https://policies.google.com/terms, https://policies.google.com/privacy.

These services can also report bounces and spam complaints to your site. That happens only if you set up the webhook address shown under Hive Mail > Bounces & Suppressions in their dashboard; each report is checked against a secret or signature that you configure before anything is accepted.

**Visitor tracking, the Live view, the reports and the contact journeys make no request to any external service.** The tracking script talks only to your own site; nothing is sent to Hive Mail, Hive Plugins or anyone else; there is no location or IP address lookup, no third-party script, font, image or pixel, and no analytics service is involved. The people who open the reports see them in your own WordPress admin, and add-ons that read the same data (such as Hive Mail Pro) run on your own site too.

== Screenshots ==

1. The Dashboard: first steps, subscriber numbers and your latest campaign.
2. Contacts with lists, tags and statuses, and the filters above the table.
3. Reports: sends, opens and clicks per day, and the revenue that followed.
4. The Visual email builder, with the settings of the selected block.
5. The automation canvas with a multi-branch welcome series.
6. The signup form editor with its live preview and the embed box.
7. Connecting a form you already have: the fields are matched for you.
8. The segment builder: pick the rules and see who matches right now.

== Changelog ==

= 1.0.0 =
* First public release: contacts, lists, tags, custom fields and segments; import and export; four email editors and templates; campaigns with A/B subject lines and reports; sending through WordPress, Mailgun or SendGrid with bounce handling; the automation canvas, recipes and form, WordPress and webhook triggers; WooCommerce and Easy Digital Downloads customers, abandoned carts and email revenue; and the optional visitor tracker with Live, Pages, Traffic Sources, Conversions and journeys.

== Upgrade Notice ==

= 1.0.0 =
First public release.

== Privacy ==

Hive Mail stores the contacts, lists, campaigns and settings you create in your own WordPress database, in tables that begin with `hm_`. It sends nothing to Hive Plugins or any other server by itself, has no telemetry and loads no remote code.

* **Email tracking** (opens and clicks) is on by default, per contact; you can make it anonymous or turn it off under Hive Mail > Settings > Tracking & Privacy.
* **Visitor tracking is off until you switch it on.** What it records, for how long, and how its consent banner and cookie work are described in the Frequently Asked Questions above.
* **Signup forms and connected forms** store the address, names and the consent wording and time. If you set up a CAPTCHA, the service you choose receives the visitor's IP address (see External services).
* **WooCommerce and Easy Digital Downloads:** when active, Hive Mail keeps a summary of each customer's orders; see the FAQ.
* **Your contacts' rights:** Tools > Export Personal Data and Erase Personal Data include Hive Mail's data, and Hive Mail suggests text for your privacy policy under Settings > Privacy.

You are the data controller for your contacts and visitors. Hive Mail provides tools to help; it does not give legal advice.

== Source code ==

The admin app is built with React and Tailwind from the `src/` folder included in this plugin. Build it with `npm install` and `npm run build` (see `package.json` and `webpack.config.js`). The bundled Action Scheduler library (GPLv3) lives in `vendor/woocommerce/action-scheduler/`. The email editor's rich-text engine is TipTap and ProseMirror (MIT licence), installed from npm and bundled into `build/` by the same build. The admin fonts, Plus Jakarta Sans and Inter (SIL Open Font License 1.1), come from the Fontsource npm packages `@fontsource/plus-jakarta-sans` and `@fontsource/inter` and are bundled into `build/fonts/`, so no fonts are loaded from third-party servers. The automation canvas is React Flow (`@xyflow/react` and `@xyflow/system`, MIT licence) with Zustand (MIT), classcat (MIT), use-sync-external-store (MIT) and the d3 modules zoom, drag, selection, transition, interpolate, color, dispatch and timer (ISC licence) and ease (BSD-3-Clause), installed from npm and bundled into `build/` by the same build. It is loaded only when a flow is opened, and nothing of it comes from a third-party server. The checkout's abandoned-cart script, `assets/js/hivemail-cart.js`, and the visitor tracker, `assets/js/hivemail-track.js`, are hand-written and shipped as they are (not minified).
