Getting Started

Using Back In Stock Notifier with Super Speedy Imports

Published · Last updated

When a product import brings out-of-stock products back into stock, the customers who asked to be told should hear about it. Super Speedy Imports works with two back-in-stock plugins so that happens: Back In Stock Notifier for WooCommerce (by CodeWooGeek) and WooCommerce Back In Stock Notifications (the official WooCommerce extension). It spots the products an import genuinely restores to stock and, after the import completes, hands their IDs to the notifier. The notifier then decides who to email and sends the emails itself.

Back In Stock Notifier: available since 2.82.0. WooCommerce Back In Stock Notifications: available since 3.53.0.

Why it needs an integration

Both notifier plugins listen for WooCommerce’s per-product stock status events. Super Speedy Imports writes stock to the database in bulk, which is where its speed comes from, so those per-product events never fire during an import. Without the integration, a restocked product would sit in stock while its subscribers heard nothing.

Requirements

  • Back In Stock Notifier for WooCommerce (by CodeWooGeek, tested with 7.3.3) or WooCommerce Back In Stock Notifications (by WooCommerce, tested with 3.3.5) installed and active. Super Speedy Imports detects each automatically; there is nothing to configure on the Super Speedy Imports side.
  • A WooCommerce product import. Other post types never trigger notifications.
  • Both editions include it: Super Speedy Imports and Super Speedy Imports Lite.

Switching it on or off for an import

When the notifier is active, every product import shows a switch for it in the After Import section at the bottom of the import’s settings, under Notify other plugins:

Back In Stock Notifier for WooCommerce – Notify Back In Stock Notifier subscribers for products restored to stock

or, for the WooCommerce extension:

WooCommerce Back In Stock Notifications – Tell WooCommerce Back In Stock Notifications about imported stock status changes, as saving the product by hand does

If both plugins are active, both switches appear and each works on its own. The same switches appear in the Ready to import? box you see when you press Preview & Run, so you can check them before every run; a switch that is off is explained there in red, for example “Off: products this import brings back in stock are not handed to Back In Stock Notifier for WooCommerce, so its subscribers are not told.”

It is ticked by default, including on imports saved before the notifier was installed. Untick it on any import that should never notify customers, for example a one-off correction or a test feed, and save the import. The choice is per import, so a daily supplier feed can notify while a manual fix-up import stays silent. Switched off, the import records nothing for that plugin and hands nothing over, so there is nothing to run afterwards.

If the notifier plugin is deactivated, the option disappears and nothing is handed over.

What counts as “restored to stock”

A product is handed over only when all of these are true:

  • it is an existing product the import updated, not a new one (a new product cannot have subscribers);
  • its stock status was out of stock or on backorder before the import;
  • the import set it to in stock;
  • the in-stock status was deliberate: either your CSV maps a stock quantity, or it maps the stock status itself.

The last point stops a price-only file from mailing everyone. If an import maps no stock column and a product has no stock status, WooCommerce needs one, so Super Speedy Imports writes in stock as a safety default. That default is never treated as a restock.

Variations are handled the same way as simple products: each variation matched and restored to stock is handed over on its own. Whether subscribers to the parent product are also told is decided by the notifier’s own settings.

With WooCommerce Back In Stock Notifications, Super Speedy Imports hands over every stock status change the extension reacts to when you save a product by hand in wp-admin, not only restocks to in stock:

Stock status beforeAfter the importWooCommerce Back In Stock NotificationsBack In Stock Notifier
Out of stockIn stockHanded over: subscribers notifiedHanded over: subscribers notified
Out of stockOn backorderHanded over: subscribers notifiedNot handed over (the notifier ignores it)
On backorderIn stockHanded overHanded over
In stockOn backorderHanded overNot handed over
In stock or on backorderOut of stockHanded over: sign-ups are re-armed for the next restockNot handed over

WooCommerce counts a product on backorder as available to buy, so the extension tells its subscribers when a product goes from out of stock to on backorder, whether the change comes from a hand save or an import. The same rules about existing products and deliberate stock values apply to every row.

What happens on each run

  1. During the import, immediately before stock statuses are written, Super Speedy Imports records each product that meets the rules above.
  2. After the import completes, as part of its after-import work, it hands each recorded product to the notifier’s own stock re-check, one product at a time.
  3. The notifier takes over. It reloads the product, applies its own checks (for example its visibility and minimum stock rules), and queues and sends its emails through its own mail queue.

Super Speedy Imports never emails customers and never changes the notifier’s subscriber records. If the notifier decides a product should not notify anyone, nobody is notified.

How the hand-off runs depends on how the import was started:

Started fromHand-off
WP-CLI (wp ssi)Delivered in full before the command finishes, with up to four workers sharing the work where the host allows extra processes to start.
The browser, or a scheduled importDelivered inside the completing request for up to 10 seconds. Anything left continues in the background through WooCommerce’s Action Scheduler.

Scheduled imports are a Super Speedy Imports (paid edition) feature.

Did you know?

If a later import or a manual edit takes a product out of stock again before its notification is handed over, that product is skipped and counted as superseded, so customers are not told about stock that has already gone.

WooCommerce Back In Stock Notifications

With the WooCommerce extension, step 2 reports each recorded product and its new stock status to the extension exactly as saving that product in wp-admin would, whether it came back in stock, went on backorder or went out of stock. The extension then applies its own rules: which product types it supports, its minimum stock setting, its rule against re-sending to the same customer within an hour, and its handling of variations. It marks the waiting notifications as queued and sends them in batches through Action Scheduler, usually within a minute or two. Each subscriber is mailed once; the extension then deactivates that sign-up, which is also what stops a second hand-over from mailing anyone again. When a product goes out of stock, the extension sends nothing; it only re-arms sign-ups that an admin had sent by hand, so they are mailed again at the next restock.

The extension has no settings that pause the hand-off.

Checking it worked

The import’s completion screen shows a Follow-up tasks panel, for example “8 products came back in stock” (or “8 product stock status changes” for the WooCommerce extension), with how many have been handed to Back In Stock Notifier, how many were superseded, and how many remain. It updates while the hand-off continues in the background, and links to the plugin’s own queue (View notifier queue for Back In Stock Notifier, View notification queue for the WooCommerce extension) so you can see the emails it has queued. Import History shows the same counts for past runs.

From the command line:

wp ssi changes --import=<import-id>
wp ssi changes --history=<history-id>

lists the counts for one import or one run.

If the panel says background processing does not appear to be running, the site’s cron is usually not running. Click Run now, or finish the hand-off from the command line, which has no time limit:

wp ssi deliver-events --import=<import-id>

Both are safe to run more than once: a product that has already been handed over is never handed over again.

Caveats

  • Two Back In Stock Notifier settings pause the hand-off. If the notifier’s own periodic third-party inventory scanner is enabled, or its setting that keeps a subscription entry subscribed after mail, Super Speedy Imports does not hand anything over, because either setting can lead to duplicate emails. The Follow-up tasks panel shows the reason. The notifier’s scanner picks up restocks on its own schedule instead. To have Super Speedy Imports hand over restocks straight after each import, disable both settings in the notifier.
  • WooCommerce Back In Stock Notifications: one case is not covered. With the extension’s minimum stock setting above zero, raising the stock of a product that is already in stock past that minimum does not notify, because its stock status does not change. With the default minimum stock of zero this never applies.
  • Seven-day limit. A restock that has not been handed over within 7 days of the import, for example because one of those settings stayed on, is dropped rather than mailed late.
  • Failures are retried by hand. If the notifier reports a failure for a product, it shows as failed in the panel. Use Run now or wp ssi retry-events --import=<import-id> once the cause is fixed.
  • Undo never notifies. Restoring products with an import undo does not trigger notifications.
  • Rebuild buttons never notify. Re-running an individual after-import task does not hand anything over a second time.
  • The import waits for the hand-off. Delivery runs inside the import’s own after-import work so it does not depend on WP-Cron. A developer can move it to the background instead with the superspeedyimports_change_event_deliver_inline filter: when it returns false, the events stay queued for the background queue runner on every runner, WP-CLI included.
Common mistake

Mapping a stock status column that says “instock” for every row will notify subscribers of every out-of-stock product in the file. Map the real stock quantity or status from your supplier, not a fixed value.

Developers can read how both integrations are built on the import’s change listener in Building change-listener integrations: the back-in-stock notifiers.

Further reading

Setting up the recurring stock feed that triggers these notifications.
Where the Follow-up tasks panel sits on the completion screen.
Running a supplier feed on a timetable from WP-CLI.

Written for Super Speedy Imports 3.65.0.

Comments

▲
▼
1/1