On a schedule
Email suppliers a reorder when stock runs low
When a product drops below 10 units, its supplier gets a reorder email from your Gmail and your team hears about it in Slack.
- Runs
- On a schedule
- Apps
- Gmail, WooCommerce
- AI
- Not needed
- Access
- Woo read; gmail.send
Send this to your assistant
Create a ClickRuntime automation: every morning, check WooCommerce stock; for products under 10 units, email the supplier a reorder request and post it to #inventory. Don't email the same reorder twice.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
In a small shop, reordering is a job squeezed between packing and customer emails. Someone notices a product is low, means to email the supplier, and the email goes out a week later, just as the product sells out.
Sending the reorder email the day stock drops low takes the reminder out of someone's head. Each supplier gets a clear request from your own address, and Slack shows the team what was ordered.
What you get out of it
Reorders go out on time
The request is sent the morning stock drops low, giving the supplier the full lead time.
Fewer sell-outs
Popular products are restocked before they disappear from the store.
Suppliers reply to you
The email comes from your Gmail address, so confirmations and delivery dates land in your inbox.
The team knows what's coming
A Slack note lists what was reordered, so nobody orders it twice by hand.
How it works
What happens, step by step
Every morning, ClickRuntime reads stock levels from your WooCommerce store.
It picks out products with fewer than 10 units that it hasn't already reordered.
It emails each product's supplier a reorder request from your Gmail address.
It posts the list of reorders to #inventory in Slack and remembers them so no supplier gets the same request twice.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect WooCommerce
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Gmail and WooCommerce steps into one automation
Under the hood
The code that runs this automation
import base64
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, notify
STORE = "https://shop.example.com/wp-json/wc/v3"
@on_trigger
def run(event):
auth = (credentials.secret("WOO_KEY"), credentials.secret("WOO_SECRET"))
products = http.get(f"{STORE}/products", auth=auth, params={"per_page": 100, "stock_status": "instock"}).json()
low = [p for p in products if p.get("manage_stock") and (p.get("stock_quantity") or 0) < 10]
sent = set(state.get("sent") or [])
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
ordered = []
for p in low:
meta = {m["key"]: m["value"] for m in p["meta_data"]}
if p["sku"] in sent or not meta.get("supplier_email"):
continue
msg = EmailMessage()
msg["To"], msg["Subject"] = meta["supplier_email"], f"Reorder: {p['sku']} {p['name']}"
msg.set_content(f"Hello,\n\nPlease send {meta.get('reorder_qty', 50)} units of {p['name']} (SKU {p['sku']}).\n\nThanks")
gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
ordered.append(f"{p['name']} ({p['stock_quantity']} left)")
sent.add(p["sku"])
if ordered:
notify.slack("Reorders sent: " + ", ".join(ordered), channel="#inventory")
state.set("sent", [s for s in sent if s in {p["sku"] for p in low}])
return {"reordered": len(ordered)}FAQ
Common questions
Where does it find the supplier's email address?
How much does it reorder?
Will it email again tomorrow if stock is still low?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Keep WooCommerce prices in line with your main store
Prices in your WooCommerce store follow your main Shopify store by SKU, and you get an email listing every price that changed.
See how it worksGet a weekly email on what reviews say about each product
Every Monday you get an email summarising last week's product reviews: the mood for each product, recurring complaints and suggestions to act on.
See how it worksMatch refund requests to orders and confirm by email
Each refund request is matched to its WooCommerce order, a note is added to the order, and the customer gets a confirmation email with the order details.
See how it worksKeep exploring
Set up “Email suppliers a reorder when stock runs low” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.