Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every morning, ClickRuntime reads stock levels from your WooCommerce store.

  2. It picks out products with fewer than 10 units that it hasn't already reordered.

  3. It emails each product's supplier a reorder request from your Gmail address.

  4. 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

RunsOn a schedule
Email suppliers a reorder when stock runs lowtoday, 9:00Succeeded
Slack · #inventoryReorders sent: Northwind Mug (6 left), Acme Tote (8 left)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
low_stock_reorder_emails.pyexample
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?
From a custom field on each product, such as supplier_email, or a small list in the script mapping SKUs to suppliers.
How much does it reorder?
A fixed quantity per product, stored alongside the supplier address. You can also ask for a quantity based on last month's sales.
Will it email again tomorrow if stock is still low?
No. Each reorder is remembered until the product is back above the threshold.
What permissions does it need?
Woo read; gmail.send. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.