Stock alerts (Notify me)
Overview
On out-of-stock product cards, shoppers can subscribe to a restock email. There is no dedicated admin settings screen for this feature; it is always flagged in widget config (features.stockAlerts: true).
How It Works
- Card shows Notify me.
- Shopper enters email; widget
POST /aiwsa/v1/stock-alertswithproduct_id+email. Stock_Alert_Servicestores the subscription.Stock_Alert_Listenerwatches stock changes;Stock_Alert_Mailersends mail when back in stock.
How to Enable It
No toggle. Requires Enable AI Agent (so the widget loads) and products that are out of stock in the assistant’s results (Include out-of-stock products or an explicit availability ask).
Configuration
None in AI Assistant settings. Emails use WordPress mail.
Frontend Usage
Bell / Notify me → email → success: “We’ll email you when this product is back in stock.”
Example
Out-of-stock starter motor card → notify shopper@email.com → restock in WooCommerce → email sent.
Behavior
| Situation | What happens |
|---|---|
| Invalid email | Client-side error |
| Duplicate | Treated as subscribed (idempotent-style success path) |
| Product in stock already | Subscribe may be rejected by the service (implementation validates product) |
Limitations
- Not a marketing list manager.
- No admin UI to export alerts in this version (table exists internally).
- Implementation status of every stock-status edge case: see
Stock_Alert_Serviceif you customize.
Troubleshooting
Button missing: product is in stock or not shown. Mail not arriving: WordPress wp_mail / SMTP, not the chat widget.