=== Followly – Email Automation for WooCommerce ===
Contributors: timo-g
Tags: woocommerce, email automation, follow-up emails, order emails, automation
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Follow-up emails for WooCommerce with real filters, delays, manual runs and a catch-up run for orders that already exist.

== Description ==

Followly sends emails automatically when something happens in your shop: an order changes status, a payment goes through, a customer registers, a product runs low. You decide exactly who gets which email and when.

Every automation is three simple boxes on a normal WordPress edit screen: what triggers it, which conditions must be true, and the email itself. No drag-and-drop builder, no external service, no account. Everything runs inside your WordPress.

= Triggers =

* Order status changed (optionally only to specific statuses)
* New order paid (payment complete)
* Order fully refunded
* Customer registered
* Product low stock / out of stock

= Conditions =

All conditions must match (AND). Among them:

* Order total, item count, status, payment method, shipping method
* Products, variations or SKUs in the order (SKU prefixes match all variants)
* Product categories and coupon codes in the order
* Billing and shipping country
* Day of the week the order was placed
* Customer: number of paid orders, lifetime spend, role, guest or account
* Product stock quantity and categories (for stock triggers)

= Timing =

Send right away or after a delay of minutes, hours or days. Delays run through Action Scheduler, which ships with WooCommerce. The conditions are checked again right before sending, because an order may have changed in the meantime (for example it was cancelled).

= Manual and catch-up runs =

* Mark an automation as "allow manual run" and it appears in a single order's *Order actions* box and as a bulk action on the orders list.
* *Run on Existing Orders* applies an automation to orders that already exist, for example everyone who bought before you set the automation up. You get a preview first. Every automation sends at most once per order by default, so running it twice is harmless.

= The email =

Subject, heading and body with placeholders such as `{billing_first_name}`, `{order_number}`, `{order_items_table}` or `{order_view_url}`. Emails use your WooCommerce email template, so they look like the rest of your shop's emails. Send to the customer, the shop admin or a custom address.

Before you switch an automation on, send yourself a test email from the edit screen. It uses what is in the form right now, saved or not, and fills the placeholders from a real order of your choice (or the latest one).

= Log =

Every run is logged: sent, queued, skipped (and why) or failed. Emails that are still queued are listed on their own and can be cancelled before they go out. Old entries are cleaned up automatically after a period you choose.

= Compatibility =

* Works with both WooCommerce order storage modes (classic and High-Performance Order Storage)
* Translation-ready

== Installation ==

1. Install and activate WooCommerce.
2. Install Followly from the plugin directory, or upload the plugin folder to `/wp-content/plugins/`, and activate it.
3. Go to *Followly → New Automation* in the admin menu.

== Frequently Asked Questions ==

= Does it need an external service or account? =

No. Everything runs inside your WordPress installation and uses WooCommerce's own email system.

= Will customers get the same email twice? =

Not by default. Each automation sends at most once per order unless you switch that off. Manual runs can deliberately resend.

= What happens if an order changes during the delay? =

The conditions are checked again right before sending. If they no longer match (for example the order was cancelled), the email is skipped and the log says why.

= Can I reach customers who ordered before I created the automation? =

Yes, with *Followly → Run on Existing Orders*. Preview the matching orders first, then send or schedule the emails, spread out over time if you like.

= Does it work with High-Performance Order Storage (HPOS)? =

Yes, with both order storage modes.

= I used the earlier "WooAutoMail" build. What happens to my automations? =

Deactivate WooAutoMail, then activate Followly. Automations, settings, the log and emails that are scheduled but not sent yet are taken over automatically.

== Screenshots ==

1. The Followly overview page.
2. All automations at a glance: trigger, timing, manual runs, status and run count.
3. Editing an automation: trigger, timing, conditions, email and the test email box.
4. Run on Existing Orders with preview.
5. The log of all runs.

== Changelog ==

= 1.0.1 =
* Fix: "is one of" / "is none of" filters on fields with fixed choices (countries, order status, payment method, ...) now let you pick several values. Before, only one could be picked, and saving an automation that already had such a list replaced it with the first entry of the dropdown.
* Fix: low stock and out of stock alerts are sent every time again. "Only ever send once per order" applies to orders only, as its name says; before, it allowed only one alert per product ever.
* Fix: the log showed "skipped_already_sent" instead of a readable status.
* New: the Log page shows which emails are still queued (per automation, with the next send time) and lets you cancel them before they go out.
* Fix: a delayed or bulk-run email no longer looks like a pending duplicate in the log. Its "Queued" entry now changes to "has run" or "cancelled", next to the separate "Sent" entry.

= 1.0.0 =
* First public release as Followly.
* New: send a test email from the automation edit screen.
* The log shows delays in days, hours or minutes and the planned send time.
* Renamed from the internal build "WooAutoMail"; existing data is migrated automatically.

== Upgrade Notice ==

= 1.0.1 =
Fixes filters with several countries or statuses being reset on save, and low stock alerts being sent only once per product. Please check automations that use "is one of" or "is none of".

= 1.0.0 =
First public release. Users of the earlier WooAutoMail build: deactivate it first, your data is taken over automatically.
