Skip to content

Collects as they arrive, acts daily

Win back abandoned carts by email, then text

Shoppers who leave checkout get a reminder email after an hour and a text the next day if they still haven't bought.

Runs
Collects as they arrive, acts daily
Apps
Gmail, Twilio
AI
Not needed
Access
gmail.send; Twilio

Send this to your assistant

Create a ClickRuntime automation: when a checkout starts, remember it; if it isn't paid after an hour, send a reminder email from my Gmail, and if it's still unpaid after 24 hours, send a text.

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

Abandoned checkouts are the cheapest sales to recover: the shopper already chose the product. But one generic email is easy to miss, and many small shops don't follow up at all.

A gentle email after an hour, followed by a short text the next day only if they still haven't bought, gives two chances to bring them back without pestering anyone who already paid.

What you get out of it

  • Recover sales you'd lose

    Many shoppers just got distracted and come back with a nudge.

  • Two chances, two channels

    Email first, then a text for those who didn't see it.

  • Buyers are left alone

    Anyone who completes their order gets nothing further.

  • Personal, from your address

    The email comes from your Gmail, not a no-reply system.

How it works

What happens, step by step

  1. Your shop tells ClickRuntime when a checkout starts and when it's paid.

  2. Each unpaid checkout is remembered.

  3. Every hour it checks: after one hour unpaid, the shopper gets a reminder email from your Gmail.

  4. After 24 hours still unpaid, they get one text, and the checkout is then forgotten.

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 Twilio
  • Paste your automation's link into the other app's webhook settings

What you get

RunsCollects as they arrive, acts daily
Win back abandoned carts by email, then texttoday, 9:00Succeeded
SMS · ShopperStill thinking it over? Your Northwind Outdoor basket is waiting: link

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

  • Act only on the items that match your own rules, and skip the rest
  • 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 Twilio 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.
abandoned_cart_recovery_by_email_and_sms.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from twilio.rest import Client
import base64, time
from clickruntime import on_event, on_trigger, credentials, http, state

FROM = "+15005550006"

def sms(to, body):
    return Client(credentials.secret("TWILIO_ACCOUNT_SID"), credentials.secret("TWILIO_AUTH_TOKEN")).messages.create(to=to, from_=FROM, body=body)
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()

def send_email(to, subject, text):
    gmail().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\n\r\n{text}".encode()).decode()}).execute()

@on_event
def handle(event):
    c, carts = event.json or {}, state.get("carts") or {}
    carts.pop(c.get("id"), None)
    if c.get("status") != "paid" and c.get("email"):
        carts[c["id"]] = {"email": c["email"], "phone": c.get("phone") if c.get("sms_ok") else None, "url": c.get("url"), "at": time.time(), "step": 0}
    state.set("carts", carts)
    return {"open": len(carts)}

@on_trigger
def run(event):
    carts = state.get("carts") or {}
    for cid, c in list(carts.items()):
        age = time.time() - c["at"]
        if c["step"] == 0 and age > 3600:
            send_email(c["email"], "You left something in your basket", f"Your basket is saved here: {c['url']}"); c["step"] = 1
        elif c["step"] == 1 and age > 86400:
            if c["phone"]: sms(c["phone"], f"Still thinking it over? Your basket is waiting: {c['url']}")
            carts.pop(cid)
    state.set("carts", carts)
    return {"open": len(carts)}

FAQ

Common questions

Do shoppers need to agree to texts?
Yes. Only text shoppers who gave their number and agreed to SMS at checkout.
Can I change the timing?
Yes. Set the delays for the email and the text.
Can I include a discount?
Yes. Add a code to either message, or only to the text.
What permissions does it need?
gmail.send; Twilio. 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 checks. Checks that find nothing new 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 “Win back abandoned carts by email, then text” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.