# How Batching & Cron Work

Mass Email Notifications relies on a batching system combined with
WordPress cron to send messages safely and consistently. Understanding
this flow helps explain why emails don’t go out instantly and how
throttling is enforced.

------------------------------------------------------------------------

## Creation

- Submitting the control form runs a feed, which creates a batch.
- The batch contains the list of recipients (from a target form or CSV),
  along with the message subject and body.
- Each batch is uniquely labeled for tracking.

------------------------------------------------------------------------

## Review Window

- After creation, the batch enters a **5‑minute Pending window**.
- During this time, you can preview the batch, cancel it, or let it
  proceed.
- This safety buffer prevents accidental “blast sends.”

------------------------------------------------------------------------

## Processing by Cron

- Once the review window ends, the batch moves to **In Progress**.
- WordPress cron jobs handle sending in small chunks according to the
  limits you set.
- An hourly cron job picks up batches, but it may be triggered sooner or
  later depending on site activity or server setup.
- When a limit is reached, the plugin schedules a one-off run for the
  moment that limit resets, so sending resumes without waiting for the
  next hourly run.

------------------------------------------------------------------------

## Resend Behavior

- If you click **Send Now**, the batch begins immediately, but still
  respects throttling limits.
- No emails are ever sent faster than the per‑minute/hour/day/month
  rules allow.

------------------------------------------------------------------------

## Why Cron Matters

- WordPress cron is “pseudo-cron” — it only runs when the site is
  visited or triggered by a server task.
- If your host disables cron, you may need to configure a server-level
  cron job that pings `wp-cron.php` regularly.
- A scheduled run only fires when cron is triggered. If you use a
  per-minute limit, set up a real server cron that pings `wp-cron.php`
  every minute. Otherwise each run sends up to your per-minute limit and
  the next one waits for the next visit or cron trigger, so the actual
  pace can be much slower than your per-minute limit.

------------------------------------------------------------------------

By combining batching with cron, the plugin ensures campaigns are paced
properly, accidental sends can be caught, and provider limits are
respected automatically.
