=== FlowMail Campaigns ===
Contributors: flowpressuk
Tags: email-marketing, automation, newsletter, woocommerce, email
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.90
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Email marketing, WooCommerce automations, customer journeys, forms, reporting, and diagnostics inside WordPress.

== Description ==

FlowMail Campaigns is an email marketing and automation workspace for WordPress and WooCommerce. It brings campaigns, customer journeys, subscribers, forms, product alerts, reporting, testing, and delivery diagnostics together inside WordPress so you can see not only what is configured, but what is actually happening and why.

Instead of presenting automations as a disconnected list of triggers, FlowMail maps them across the customer journey: consent and signup, welcome, first purchase, post-purchase, loyalty, cart recovery, inactivity, win-back, and product interest. Guidance shows which automations are recommended, optional, alternatives, or protected from broader audiences.

No external FlowPress service is required for plugin functionality. Operational data stays in WordPress, and email is sent through your site's WordPress mail configuration or an SMTP server you choose.

**Customer journey and automations**

* Journey View organises automations across the real customer lifecycle.
* Recommended, Alternative, Optional, System, and Protected guidance badges explain how each automation should be used.
* Use single triggered emails or multi-step workflows without accidentally running duplicate paths.
* Progressive High-value and VIP loyalty tiers can use different lifetime-spend thresholds and rewards.
* Protected win-back paths separate standard inactive customers from High-value/VIP recovery audiences.
* New subscriber, welcome follow-up, lead magnet, anniversary, birthday, inactivity, and lifecycle automations are available where appropriate.
* First-order, repeat-customer, post-purchase, review-request, loyalty, abandoned-cart, and purchase-inactivity automations can use WooCommerce completed-order data.

**Campaigns and scheduling**

* Create one-time email campaigns.
* Schedule campaigns for a future date and time.
* Run recurring campaigns on repeat schedules.
* Use UK seasonal campaign starters for common retail dates.
* Reuse templates, placeholders, and linked customer offers.
* Keep campaigns separate from trigger-based automations so planned sends and lifecycle messaging remain easy to understand.

**WooCommerce customer lifecycle**

When WooCommerce is installed and active, FlowMail can use completed orders as the source of truth for customer lifecycle and value classification.

* Recognise first-order and repeat customers.
* Trigger post-purchase follow-up and review requests.
* Reward High-value and VIP customers when configured spend thresholds are crossed.
* Recover abandoned carts through a dedicated recovery workflow.
* Re-engage inactive buyers with separate standard and High-value recovery paths.
* Attribute qualifying later purchases back to FlowMail email activity when attribution evidence exists.
* Capture an optional marketing opt-in alongside customer contact details at checkout.

**Product interest alerts**

Product alerts are request-driven rather than general lifecycle marketing. Customers can ask to receive:

* Back-in-stock notifications.
* Price-drop notifications.
* Category new-arrival notifications.

FlowMail keeps those requests separate from normal customer automations and can track real opens and clicks while excluding test sends from engagement figures.

**Subscribers, audience, and preferences**

* Subscriber profiles combine identity, acquisition source, preferences, interests, tags, lifecycle context, purchases, and engagement.
* Customer Journey shows milestones such as welcome, purchases, loyalty, recovery, and email engagement.
* Segments create reusable audience groups for campaigns and automations.
* Subscriber preferences and unsubscribe handling let people control what they receive.
* Double opt-in, hard/soft bounce, complaint, and suppression information help keep sending safer.
* Acquisition tracking records how subscribers entered FlowMail, including forms, WooCommerce, imports, and retained source context.

**Forms, Inbox, and reviews**

* Subscriber signup forms.
* Contact enquiry forms.
* Selling enquiry forms.
* WordPress block-editor and popup tools for FlowMail forms and subscriber-update content.
* Internal Bot Shield to reduce automated form spam without relying on a third-party CAPTCHA service.
* Inbox for managing incoming form enquiries.
* Manual Google-style review badge and copy/paste review imports without a Google API connection.

**Email operations and reporting**

* Waiting to Send shows queued, future, due, held, or failed email.
* Sent Emails keeps delivery history and source context.
* Email Results compares Campaigns, Automations, and System email.
* Track delivery, opens, clicks, outcomes, and conversions where supported.
* Test sends remain separate so they do not distort real performance.
* Campaign Activity provides drill-down into audience, queue, and result history.
* Tracking Diagnostics helps verify open/click tracking and automation provenance.

**Automation testing and diagnostics**

FlowMail includes tools for checking automation behaviour before waiting for a live customer event. Depending on the workflow, the testing area includes:

* Quick Test.
* Trigger Simulator.
* Customer Scan.
* Audience Check.
* Customer Simulation.
* Time Travel.
* Cart Inspector.
* Waiting to Send.
* Activity Feed.
* Diagnostics.
* Event Ledger.

These tools help explain whether an automation should fire, who currently matches a rule, what is waiting to send, and what evidence exists behind an automation event.

**Meaningful activity, not background noise**

The Activity workspace combines audience, purchase, campaign, automation, review, content, and system events while keeping future work under Upcoming. Routine queue, cron, maintenance, and watchdog noise is hidden from the normal business timeline, but important failures remain visible. Full technical history is still available under System when deeper investigation is needed.

**System email and branding**

* Double opt-in confirmation, reminders, cleanup rules, delivery checks, and test sends are managed in one place.
* Password-reset email content can be customised.
* WordPress login branding can use a custom logo, background, button colour, and message.
* Content publishing activity can be reviewed alongside email marketing and customer engagement.

**Health, delivery, and send safety**

* Health Check monitors the database, automation engine, queue, delivery, tracking, and watchdog.
* Optional SMTP configuration can be used instead of the site's default WordPress mail transport.
* Sender-domain, SPF, DMARC, and DKIM checks help surface delivery configuration issues.
* Watchdog and cron recovery help detect and restore required scheduled jobs.
* Send-safety checks reduce the risk of duplicate, stale, or unsafe sends.
* Mail transport failures are captured for diagnosis.

**Built for WordPress control**

FlowMail does not require a fixed external FlowPress API or hosted email-marketing account. Subscriber, campaign, automation, activity, and reporting data is managed inside WordPress. If you choose to use an SMTP provider, outgoing email is delivered through the SMTP server you configure.

All features described here are included in FlowMail Campaigns; WooCommerce-specific features require WooCommerce to be installed and active.

== Installation ==

1. Upload the `flowmail-campaigns` folder to `/wp-content/plugins/`, or upload the ZIP through **Plugins → Add New → Upload Plugin**.
2. Activate **FlowMail Campaigns** from **Plugins → Installed Plugins**.
3. Open **FlowMail Campaigns → Settings** to configure sender details, SMTP options, forms, and safety settings.
4. Create your first campaign under **FlowMail Campaigns → Campaigns**.

== Frequently Asked Questions ==


= Does this use a third-party email service? =

No external email platform is required by default. Emails are sent through your WordPress mail configuration. If you configure SMTP, email delivery is handled by the SMTP provider you choose.

= What data is sent to external services? =

FlowMail Campaigns does not send operational data to FlowPress. If SMTP is enabled, email data is sent to the configured SMTP provider when an email is sent. This can include recipient email addresses, sender details, subject lines, message content, and email headers.

= Does FlowMail Campaigns connect to FlowPress? =

No external FlowPress connection is required for plugin functionality. Links to FlowPress are provided for documentation, support, and product information only.

== External services ==

FlowMail Campaigns does not send operational data to FlowPress or to a fixed external API.

By default, emails are sent through WordPress using `wp_mail()`, which uses the site's own mail configuration. If the site administrator enables the optional custom SMTP setting, outgoing email is sent to the SMTP server entered by that administrator when an email is sent. Depending on the email being sent, this can include recipient email addresses, sender details, subject lines, message content, and technical email headers.

The SMTP server is not supplied by FlowMail Campaigns and is not required for the plugin to work. Site administrators who enter their own SMTP server details should review the terms and privacy policy for that chosen mail provider.

The plugin also includes an admin-only WP-Cron loopback diagnostic. When an administrator runs that diagnostic, the site sends a request to its own `wp-cron.php` URL to confirm that scheduled tasks can run. No FlowPress service is contacted for this check.

The Reviews screen includes a manual Google-style review badge and a copy/paste importer for reviews that an administrator chooses to copy from their public Google review page. This feature does not contact Google, does not scrape Google, and does not use a Google API key.

== Screenshots ==

1. FlowMail Overview brings together key activity, upcoming work, campaign and automation status, and shortcuts to the areas that need attention.
2. Journey View maps automations across the customer lifecycle, showing recommended steps, optional extras, alternative workflows, progressive loyalty tiers, and protected win-back paths.
3. Campaigns keeps one-time, scheduled, recurring, and seasonal sends separate from trigger-based automations.
4. Audience management brings subscriber status, acquisition, preferences, interests, lifecycle context, and customer information together in one place.
5. Built-in forms cover subscriber signup, contact enquiries, and selling enquiries, with WordPress blocks, popups, and Bot Shield protection.
6. Segments create reusable audience groups so campaigns and automations can target the right subscribers without rebuilding filters each time.
7. Email Results compares delivery, opens, clicks, outcomes, and conversions across campaigns, automations, and system email.
8. Help & Status provides health checks and diagnostics for the database, queue, scheduling, email delivery, tracking, watchdog, and automation engine.

== Changelog ==

= 1.3.90 =
* Treats correctly ordered High-value and VIP spend tiers with distinct offers as an intentional progressive loyalty path rather than an overlap warning.
* Shows a positive Progressive tiers status when VIP is above High-value and the two linked rewards are distinct.
* Keeps genuine tier problems actionable: reversed/equal thresholds, missing threshold data or identical tier offers still show Review tiers with an explanation.
* Keeps anniversary and birthday visible as optional loyalty extras without making a healthy progressive tier setup look like a warning.

= 1.3.89 =
* Makes general Customer inactive and Lapsed high-value purchase win-back audiences mutually exclusive.
* Customers below the High-value threshold use the general win-back path; High-value and VIP customers use the targeted lapsed-high-value path instead.
* Adds defensive audience protection to live queueing and dry-run/testing paths so High-value customers cannot be queued into the broader customer-inactive automation.
* Journey view now shows Protected paths, marks Lapsed high-value as Protected, and displays the exclusion directly in the configured rules.
* Keeps High-value and VIP loyalty milestones progressive; a distinct VIP offer such as the current £20 reward is treated as intentional rather than a duplicate offer.

= 1.3.88 =
* Explains why Journey view flags High-value/VIP and win-back audience overlaps instead of only asking admins to review them.
* Shows when VIP is nested inside High-value (or when tier thresholds are reversed/equal), using the live configured lifetime-spend thresholds.
* Flags when VIP and High-value currently use the same linked offer, without changing either automation automatically.
* Explains the exact inactivity timing at which a lapsed high-value customer can also enter the broader customer-inactive recovery path.

= 1.3.87 =
* Makes Journey review warnings actionable by showing the actual configured audience rules directly beneath the guidance.
* Repeat & loyal customer shows the active High-value and VIP lifetime-spend thresholds plus any linked offer and minimum-spend details.
* Inactivity & win-back shows the configured customer-inactivity days and lapsed-high-value inactivity/value thresholds, plus linked offer details where present.
* Keeps rule summaries compact and omits values that are not configured.

= 1.3.86 =
* Refines Journey view stage statuses so they explain where attention is useful instead of marking every active stage simply Covered.
* Repeat & loyal customer now shows Review optional extras when High-value, VIP, anniversary or birthday automations are active, with an explicit overlap warning when both High-value and VIP spend tiers are enabled.
* Inactivity & win-back now flags Review overlap when lapsed high-value recovery is active alongside a general customer win-back path, because the same customer may meet both audiences.
* Product interest alerts is now labelled Request-driven rather than Covered, reflecting that those alerts only send after a shopper asks to watch a product or category.
* Aligns the top journey-step names with the section headings below: New subscribers, After purchase, Repeat & loyal customer, Inactivity & win-back and Product interest alerts.

= 1.3.85 =
* Makes the customer/subscriber Journey view the default Automations view while retaining the existing detailed Table view and filters.
* Groups automations into signup, welcome, first purchase, post-purchase, loyalty, cart recovery, win-back and product-interest stages.
* Adds Recommended, Alternative, Optional and System guidance badges so admins can see which automations are sensible defaults, substitutes, situational extras or operational processes.
* Adds stage-level coverage guidance and overlap warnings when both a multi-step workflow and its equivalent individual-email path are active.
* Adds a clickable customer-journey summary; selecting a stage opens Table view filtered to that journey stage.
* Journey Manage buttons open the matching detailed automation row, keeping existing edit, testing and action controls in one place.

= 1.3.84 =
* Fixes the WooCommerce checkout marketing opt-in appearing twice on classic checkout.
* Keeps the canonical opt-in beside the billing email/contact fields and removes the duplicate copy previously forced beside the Place order button.
* Retains the legacy renderer method for compatibility without hooking it into checkout.

= 1.3.83 =
* Adds open and click tracking to real System product-alert emails using the same tracked-email pipeline as campaigns and normal automations.
* System Email Results now shows an Engagement summary in Essential view and Tracked, Opened, Clicked, Open rate and Click rate metrics in Full view.
* Double opt-in System results now surfaces unique opens, confirmation-link clicks and confirmed outcomes from the existing confirmation journey tracking.
* Test sends remain excluded from engagement figures and do not create tracked System queue records.
* Engagement rates use tracked real sends only, so older System alert deliveries remain visible in Sent without distorting open/click rates.
* Keeps delivery health independent from engagement metrics; open activity does not change the automation health score.

= 1.3.82 =
* Fixes Login Page branding so saved logo, background and button colours are applied reliably to the live WordPress login screen.
* Login branding now uses the core WordPress login stylesheet handle and links a custom login logo back to the site.
* Clarifies that Login Page colour placeholders are examples rather than active values until saved.
* Removes the duplicate Double Opt-In management button from Email & Login.
* Splits Double Opt-In Delivery & testing into Delivery health and Content checks for easier scanning.
* Trims the public WordPress.org changelog to recent releases so it stays within the directory import limit.

= 1.3.81 =
* Consolidates Double Opt-In management into the Double opt-in reminder & cleanup System Automation screen.
* The unified screen now owns follow-up timing, reminder limits, automatic cleanup, initial confirmation copy, reminder copy, delivery checks, test sends, pending counts and last-run status.
* Subscribers keeps pending-contact maintenance tools but replaces duplicate automatic follow-up settings with a read-only summary and Manage automation shortcut.
* Email & Login no longer duplicates Double Opt-In editors; its Double Opt-In tab now links to the System Automation source of truth.

= 1.3.80 =
* Clarifies grouped cron recovery diagnostics by distinguishing unique recovered jobs from the underlying recovery attempts.

= 1.3.79 =
* Cron recovery grouping now carries the recovered hook names into the aggregate instead of losing them while building the global activity timeline.
* Grouped recovery detail shows up to three readable job names, followed by a compact +N more count when additional jobs were recovered.

= 1.3.78 =
* Aggregates same-day cron recovery bursts into one technical activity row instead of listing each recovered hook separately.
* Preserves the individual recovered hook names in the grouped cron-recovery detail.

= 1.3.77 =
* Clarified the Activity System filter so its main badge continues to count important system events only.
* When System is selected, the page now shows explicit Important and All technical choices with a count on both views.
* All technical now reports the full System history count for the selected date window, including grouped routine technical events plus any important system events.
* Added an inline explanation that routine queue, cron, watchdog, maintenance and recovery history remains available without inflating the main Activity totals.

= 1.3.76 =
* Removed abandoned-cart sweep maintenance passes from Overview Latest Activity and the default Activity -> All timeline.
* Keeps abandoned-cart sweep history under System -> All technical and aggregates same-day passes, including the total carts marked abandoned.
* Removed auto-discarded Bot Shield/spam form submissions from meaningful Activity while keeping held/blocked submissions visible when they need review.
* Meaningful Activity KPI/filter totals now exclude those maintenance/spam housekeeping rows as well.

= 1.3.75 =
* Activity/Overview polish: Overview Latest Activity now uses meaningful events only and hides routine queue/cron/maintenance noise.
* Keeps routine operational events under System -> All technical while warnings/failures remain visible in normal activity.
* Tightens queue/system event classification so failures are never hidden by broad queue-runtime matching.
* Activity KPI/filter counts now exclude hidden routine events; repetitive technical rows remain grouped.
* Uses friendly full timestamps in the Activity timeline while keeping Upcoming separate and true Campaign/Automation types.

= 1.3.74 =
* Cleaned the Overview Latest Activity feed so routine queue no-op, cron recovery and maintenance noise no longer displaces meaningful business activity.
* Added System detail controls on the Activity page: Important by default, with All technical available on demand. Routine technical events are grouped to keep the timeline readable.
* Corrected Upcoming classification so scheduled/recurring date campaigns appear as Campaigns while genuine trigger-based sends remain Automations.
* Updated Upcoming cards and dashboard activity timestamps to friendlier site-local date/time labels.
* Kept system failures, overdue/held delivery problems and other actionable errors visible in the normal timeline while deeper diagnostic evidence remains in Health Check and Event Ledger.

= 1.3.73 =
* Added a cross-app Activity timeline covering audience, purchases, campaigns, automations, reviews, content and system events.
* Added a dedicated Activity workspace page with area, status, date and search filters.
* Split future scheduled campaigns and queued emails into Upcoming so they are never presented as historical activity.
* Updated the Overview Latest Activity panel to use the global timeline and added a compact Upcoming section.
* Added Activity to the FlowMail workspace navigation and kept low-level technical events in Health Check / Event Ledger.

= 1.3.72 =
* Fixed Notification Center queue alerts so future-scheduled pending emails remain normal Waiting to Send activity and do not count as items needing attention.
* Added a 15-minute grace window after the scheduled send time before a pending email is treated as overdue, avoiding false alerts from ordinary WP-Cron timing.
* Failed emails still alert immediately; held/paused emails only alert after their send time is overdue, and genuinely stuck processing items are surfaced.

= 1.3.71 =
* Fixed core subscriber automation provenance so hourly Welcome follow-up, inactive, anniversary, birthday and lead-magnet scans record genuine live queue activity as Automatic instead of legacy/unknown.
* Manual birthday/anniversary scans from the Automation Testing Center now record Manual provenance and cannot falsely validate a live trigger.
* Added a bounded one-time repair for legacy Subscriber anniversary queue/log rows whose activity date matches the subscriber join month/day, allowing Email Results and diagnostics to recognise historic automatic anniversary scan activity without treating unrelated legacy sends as proof.

= 1.3.70 =
* Reworked the Subscribers Column guide into compact groups that mirror the table: Subscriber, Profile, Engagement, Customer, Acquisition & Preferences, and System.
* Removed non-column material from the guide and moved inactivity-rule and bulk-action guidance into Help & Shortcuts.
* Added concise hover tooltips to subscriber table column headings.
* Made the guide remember its open/closed state and follow Essential/Full view, with the advanced Origin note shown only in Full view.

= 1.3.69 =
* Cleaned the Subscribers Interest filter so it only shows customer-facing product/category topics instead of raw internal tags.
* Merged duplicate interest/category aliases into one readable option and excluded product IDs, alert tags, birthdays, source tags, spam/admin metadata, and other system context.
* Updated the Interest table column to show the same clean topic labels used by the filter.
* Kept subscriber-selected email choices under Preference with clearer labels and renamed the table section to Acquisition & Preferences.
* Kept the legacy Interest filter query key for bookmarked admin URLs while matching both historic interest:<slug> and category:<slug> storage aliases.

= 1.3.68 =
* Resolve subscriber acquisition sources from forms, WooCommerce orders/registration, imports and retained provenance.
* Clean up acquisition maintenance controls and preserve tag timestamps during tag updates.


= 1.3.67 =
* Makes completed WooCommerce orders the source of truth for customer lifecycle, value tier and recent-buyer status.
* Contacts with no completed orders now show No customer lifecycle yet, Value tier: Not applicable, and Recent buyer: No even if an older managed tag is stale.
* Adds completed-order count to the shared WooCommerce customer facts and calculates lifetime spend from completed orders only.
* Clears cached purchase facts immediately when an order completes so New/Repeat/value-tier classification updates on the same request.
* Adds a one-time background classification repair that removes stale managed customer tags while preserving acquisition, preference, origin, health and manual tags.
* Hardens High-value/VIP safety scans so stale tags cannot dispatch value-tier automations to non-purchasers.

= 1.3.66 =
* Adds Welcome email and Welcome follow-up milestones to the Subscriber Customer journey, including future scheduled welcome mail that automatically becomes a sent milestone after delivery.
* Adds the latest genuine Subscriber anniversary milestone only after at least one full calendar year has passed since joining FlowMail.
* Enriches a valid anniversary milestone with the anniversary email subject when that email was sent.
* Keeps the historic same-year anniversary misfire visible in Email engagement as factual send history, but excludes it from Customer journey so it is never presented as a real anniversary.

= 1.3.65 =
* Prevents Subscriber anniversary from firing in the subscriber's original signup year; the first anniversary is now one full calendar year after joining.
* Keeps anniversary sends recurring annually on the join month/day after the first year, with the existing per-anniversary de-duplication.
* Updates Customer Simulation and testing guidance so same-year join dates correctly report that the first anniversary has not yet been reached.
* Clarifies anniversary wording in automation descriptions and diagnostics.

= 1.3.64 =
* Treats future-scheduled automation emails as healthy queue work rather than Health Check warnings.
* Automation firing diagnostics now separate scheduled, due-soon and genuinely attention-needed queue items.
* Waiting to Send sidebar counts remain informational blue when all queued mail is scheduled normally, turning amber only when something is overdue, held, paused, failed or stuck processing.
* Uses canonical automation display names in automation firing diagnostics.

= 1.3.63 =
* Keeps New customer before Repeat customer when WooCommerce records the first two completed orders within the same minute, so the customer journey remains logically ordered.
* Compacts engagement emails individually when their detailed open/click/site/order evidence has expired, even if newer retained engagement events still exist for the same subscriber.
* Replaces repeated empty engagement-stage boxes with one scan-friendly row showing send time, canonical email name, source type, and an honest retained-detail status.
* Keeps the full Sent → Opened → Clicked → Site activity → Order/goal journey only for emails that still have retained evidence.

= 1.3.62 =
* Consolidates the subscriber profile into clearer Profile, Journey, Purchases, Subscriptions, Engagement, and Delivery areas.
* Removes the duplicate Subscriber overview card and moves its unique identity and engagement details into the main profile context panel.
* Combines marketing preferences with product/category alerts in one Subscriptions & preferences section.
* Combines double opt-in and bounce/suppression information in one Consent & delivery health section.
* Makes Engagement journey the primary email-history view and moves raw sent/open/click tables into a collapsed Technical email records disclosure.
* Compacts historical engagement journeys when detailed event rows have expired, avoiding repeated empty Opened/Clicked/Site/Order boxes.
* Uses Imported to FlowMail wording in the at-a-glance summary when the subscriber was imported.

= 1.3.61 =
* Adds a grouped subscriber Engagement journey: Sent → Opened → Clicked → Site activity → Order/goal.
* Groups retained engagement by email instead of showing only raw open/click rows.
* Adds All, Campaigns, Automations, and System filters plus Show all/Show fewer controls.
* Distinguishes test emails and directly attributed WooCommerce orders.
* Improves the Customer journey latest-engagement milestone with the actual email name/subject when retained tracking detail exists.
* Clearly explains when older detailed engagement rows have been cleaned up while lifetime totals remain.

= 1.3.60 =
* Polished Subscriber profiles with a compact relationship summary showing FlowMail join date, customer-since date, completed orders, spend, latest purchase and latest engagement.
* Added persistent collapsible profile sections with smart defaults, per-subscriber saved state, and Expand all / Collapse all controls in the sticky jump navigation.
* Product/category alerts, opt-in activity and healthy deliverability sections now collapse automatically when there is nothing requiring attention; purchase and journey sections stay open by default.
* Email Activity now has a compact collapsed summary while retaining expandable sent/open/click tables and remembers table expansion state per subscriber.
* Imported subscribers now show an explicit “Imported into FlowMail” journey milestone, clarifying when customer activity predates the FlowMail record.
* Purchase summaries now distinguish unique products from total item quantity.
* Subscriber sidebar totals remain informational blue even when pending confirmations exist; pending context remains available in the badge description.

= Earlier releases =
* Earlier release history is retained in the project source history. The public WordPress.org changelog lists recent releases only.
