Skip to content
weLabsweLabsStorefront Playbook
Live demoQuickstart

Store admin

Emails and background jobs

Edit the six customer emails the Companion plugin adds to WooCommerce, make sure they are delivered, and keep its scheduled jobs, including the signals that keep the storefront's pages up to date, running on time.

The storefront never sends email itself. Account emails (verification, password reset, security alerts) and back-in-stock alerts are sent by WordPress through six standard WooCommerce emails that the Companion plugin adds. Some work runs in the background on a schedule: telling the storefront which pages to rebuild after a change, sending restock alerts, tidying old data. This page covers both, and the one-minute cron job that keeps the background work on time.

  • Set the Storefront URL under StoreFront → Settings → General. Every link in these emails points to the storefront. Without it, they fall back to WordPress’s API, which answers with raw JSON instead of a page. See Connect the storefront.
  • Make sure your site can actually deliver email (see below). New customers must verify their email address before they can sign in, so a site that cannot send mail locks new customers out.
WooCommerceSettingsEmails

All six appear in WooCommerce’s email list alongside its own emails, and use your WooCommerce email header, footer and colours. Each is sent to the shopper; there is no recipient to set.

Email When it is sent Default subject Default heading
Email verification A customer registers on the storefront, or asks for the verification email again. The link lasts 24 hours. Verify your email address for {site_title} Confirm your email address
Security alert A stolen sign-in session is suspected (a session token was reused), so the customer is signed out of every device. Security alert for your {site_title} account Suspicious activity detected
Password reset A customer uses “Forgot password” on the storefront. The link lasts 1 hour. Reset your {site_title} password Password reset request
Back-in-stock sign-up: verify email A guest asks to be told when a product is back. The link lasts 24 hours. Signed-in customers don’t get this email. Confirm your back-in-stock alert for {product_name} Confirm your email address
Back-in-stock sign-up: confirmed The guest clicks the confirmation link. Mentions the customer account created for them, if one was. You are on the list for {product_name} We will let you know
Back in stock The product is restocked. Shows the product image, the chosen options and the current price, with a Shop now button. {product_name} is back in stock! Good news — it is back
  1. Go to WooCommerce → Settings → Emails.
  2. Click Manage (or the email’s name) next to the email.
  3. Change the fields you need, then click Save changes.
Setting What it does Default
Enable/Disable Sends or stops this email. Enabled
Subject The subject line. Leave blank to use the default shown above. Blank
Email heading The heading inside the email. Leave blank to use the default. Blank
Additional content Extra text below the main content. See the caution below. Blank
Email type Plain text, HTML or multipart. HTML
Cc(s) / Bcc(s) Extra recipients. Only shown when WooCommerce’s improved email feature is on. Blank

In the subject and heading you can use WooCommerce’s usual placeholders: {site_title}, {site_address}, {site_url} and {store_email}. The three back-in-stock emails also accept {product_name}.

The main wording of each email is in a template file. A developer can override it the usual WooCommerce way, by copying the plugin’s template into the WordPress theme as woocommerce/emails/rsc-*.php (for example rsc-back-in-stock.php). The theme’s copy is used instead of the plugin’s.

WordPress sends mail with the server’s basic mail function by default, and many hosts either block it or land it in spam. For a live store:

  1. Install an SMTP or transactional-email plugin and connect it to a mail service. If you already use the Brevo plugin for the newsletter, it can also send your site’s email.
  2. Use a sender address on your own domain, and add the SPF and DKIM records your mail service asks for.
  3. Send a test email from the SMTP plugin.
  4. Register a test account on the storefront and confirm the verification email arrives and its button opens the storefront.

The Companion plugin schedules a few jobs of its own. None needs any setup beyond the cron job, and you will rarely need to look at them.

The storefront keeps its pages ready in a page cache, and these jobs are how it hears that one is out of date:

Job How often What it does
rsc_send_product_purge, rsc_send_listings_purge, rsc_send_settings_purge, rsc_send_home_sections_purge, rsc_send_content_pages_purge, rsc_send_signal_purge 15 seconds after a change is saved, once for a run of changes Tell the storefront what changed: a product, the listings it appears in, the StoreFront settings, Home sections, content pages, the blog, brands or categories. The storefront then rebuilds the pages that show it.
rsc_check_storefront_catalogue, rsc_check_home_best_sellers After catalogue or order changes Check whether the category, brand and tag lists, or Home’s best sellers, really changed, and send the matching signal if so.
rsc_storefront_daily_purge Daily at 04:00, site time Freezes the day’s best-selling and top-rated order, and has the storefront rebuild the listings and Home pages that depend on it.
rsc_storefront_heartbeat Every 10 minutes Starts the storefront’s rebuild of its pages after a deploy, picks up one that stalled, runs the hourly check (a sixth of the pages each time), and brings back its progress for the Caching tab.

The other jobs:

Job How often What it does
rsc_backfill_brand_primary_category Daily Works out each brand’s main category (from up to 50 of its products) for the brands page’s category badges and filter.
rsc_rebuild_trending_categories Daily, plus once shortly after first install Ranks categories by items sold in the last 30 days, for the home page’s trending categories.
rsc_stock_notifications_cleanup Daily Deletes guest stock-alert sign-ups that were never confirmed, after the number of days set on the Stock alerts tab.
rsc_contact_entries_cleanup Daily Permanently deletes contact entries that have been in the Trash for more than 30 days.
rsc_review_media_cleanup Daily Deletes review photos and videos uploaded more than a day ago but never submitted (up to 100 per run).
rsc_send_stock_notifications Once per restocked product Sends back-in-stock emails, in batches of 50, after the send delay.
rsc_seo_sync_batch When you click Sync SEO Fills SEO blanks between the plugin and Yoast SEO or Rank Math, 500 items per batch.

The daily cleanup jobs run through WordPress’s scheduler (WP-Cron). The storefront’s jobs and the one-off batch jobs run through Action Scheduler, which comes with WooCommerce, so you can watch them under WooCommerce → Status → Scheduled Actions (groups rsc-storefront-purge, rsc-stock-notifications and rsc-seo-sync). Action Scheduler itself is driven by WP-Cron, so all of them wait for the cron job below.

Deactivating the plugin unschedules its daily jobs; they are scheduled again when it is next active.

WordPress runs its scheduled jobs only when someone loads a WordPress page. A headless store’s shoppers visit the storefront, which serves its pages from its own cache, so WordPress can go a long time without a visit. Every job then waits:

  • the signals that tell the storefront a page has changed;
  • the 04:00 Daily Purge and the ten-minute Heartbeat;
  • WooCommerce’s scheduled sale starts and ends;
  • backups made by a backup plugin;
  • back-in-stock emails.

The fix is a real cron job that runs WordPress’s scheduler every minute. The minute matters: each signal waits for the next run, so a cron every five or ten minutes makes every change that much later on the storefront.

Without one, once any scheduled job is more than half an hour overdue, every wp-admin page shows a warning that starts “The backend has no working clock”, naming the oldest job and how late it is. The warning needs someone to open wp-admin, and a cron that runs every ten minutes never sets it off, so its absence alone doesn’t prove the cron is right.

A developer or your host can set it up. The commands below use WP-CLI. Replace www-data with the user that owns the WordPress files, /path/to/wordpress with the WordPress folder, and /usr/bin/php8.3 with the PHP the web server runs. The server’s default php can be a different version.

  1. Keep WP-Cron off page visits. In wp-config.php:

    define( 'DISABLE_WP_CRON', true );
  2. Run what is overdue once, by hand, under the lock the cron job will use. A site that has been without a cron can have many overdue jobs, backups among them, so this can take a while.

    Terminal window
    sudo -u www-data flock /tmp/wp-cron.lock /usr/bin/php8.3 /usr/local/bin/wp --path=/path/to/wordpress cron event run --due-now
  3. Add the cron job. On Debian or Ubuntu, as a file in /etc/cron.d:

    Terminal window
    sudo tee /etc/cron.d/wp-cron-shop >/dev/null <<'EOF'
    # Runs WordPress's due cron events once a minute. Keep this file's name free of dots.
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    * * * * * www-data flock -n /tmp/wp-cron.lock /usr/bin/php8.3 /usr/local/bin/wp --path=/path/to/wordpress cron event run --due-now --quiet >> /path/to/logs/wp-cron.log 2>&1
    EOF
    sudo chmod 644 /etc/cron.d/wp-cron-shop

    Or put the same line, without the www-data field, in the site user’s own crontab (sudo crontab -u www-data -e). flock -n makes sure two runs never overlap.

  4. No shell access? Ask your host for a control-panel cron job that runs every minute, using wp cron event run --due-now where WP-CLI is available, or else a request to https://cms.example.com/wp-cron.php?doing_wp_cron.

  5. Check it a few minutes later:

    Terminal window
    sudo journalctl -t CRON --since "5 min ago"
    tail -n 20 /path/to/logs/wp-cron.log
    wp cron event list --fields=hook,next_run_relative

    You should see one CRON line a minute, an empty log, and no event whose next run is in the past. In wp-admin, WooCommerce → Status → Scheduled Actions shows no past-due actions, and rsc_storefront_heartbeat completes every ten minutes.

WooCommerce books its daily sale sweep (woocommerce_scheduled_sales, which starts and ends scheduled sales) for midnight in the site’s time zone when it is activated, and the Companion plugin’s Daily Purge runs at 04:00 site time. Set Settings → General → Timezone first. On a store set up the other way round, check that the sweep is waiting for midnight site time:

Terminal window
wp action-scheduler action list --hook=woocommerce_scheduled_sales --status=pending

If it is booked for any other time, or twice, book it again:

Terminal window
wp cron event delete woocommerce_scheduled_sales
wp action-scheduler action cancel woocommerce_scheduled_sales --group=woocommerce --all
wp eval 'WC()->register_recurring_actions();'

Even with the cron job, the sweep drifts a little later each time it runs late, because Action Scheduler books the next run from when the last one ran. The Companion plugin puts it back: on every wp-admin visit and at each Daily Purge, a sweep booked more than 15 minutes from midnight site time is booked again for the next midnight. The three lines above do the same by hand.

To fill in the brands page’s category badges straight away on a new store, rather than waiting for the daily job, a developer can run it once:

Terminal window
wp cron event run rsc_backfill_brand_primary_category
Symptom Likely cause Fix
Email buttons open a page of raw JSON The Storefront URL is not set. Set it under StoreFront → Settings → General.
Customers never receive verification emails The site cannot deliver mail, or the email is disabled. Set up SMTP and check WooCommerce → Settings → Emails.
A change saved in wp-admin takes minutes or hours to show on the storefront No cron job, or one that runs less often than every minute. Set up the one-minute cron job. The Caching tab shows where the rebuild stands.
Restock emails arrive hours late WP-Cron only runs on WordPress visits. Set up a real cron job.
Many past-due actions in Scheduled Actions The scheduler is not running often enough. Set up a real cron job.
Scheduled sales start or end hours late WooCommerce’s sale sweep is booked for the wrong time, or no cron job runs it. Open wp-admin once (the plugin books it again), and set up the cron job.
The sale sweep re-saves products every night whose sale ended long ago WooCommerce 10.5 to 11.1 keep an ended sale’s dates but their sweep still treats it as due to start and due to end (woocommerce/woocommerce#66720). Update WooCommerce to 11.2.0 or newer; then clear the ended sales’ price and dates once (the Companion plugin’s decision record 0014).
Customers got two restock emails WooCommerce’s experimental back-in-stock feature is also on. Remove WOOCOMMERCE_BIS_ALPHA_ENABLED from wp-config.php.
Brand cards show no category The daily brand job has not run yet. Wait a day, or run the job once with WP-CLI.
Storefront Playbook · Built by weLabsFeaturesFAQTalk to us