The moment it happens
Get a text for each sale and thank the buyer by email
Each new sale sends you a text with the amount and the buyer a thank-you email from your Gmail.
- Runs
- The moment it happens
- Apps
- Gmail, Twilio
- AI
- Not needed
- Access
- Twilio; gmail.send
Send this to your assistant
Create a ClickRuntime automation: when a new sale comes in, text me the amount and product, and email the buyer a thank-you from my Gmail.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Independent sellers want to know about each sale quickly, to ship it or simply to see things working, and they know a personal thank-you brings customers back. Doing both by hand for every order doesn't last.
A text to your phone and a thank-you from your own email address happen together the moment the sale comes in, whatever time of day it is.
What you get out of it
Know about every sale
A text arrives on your phone the moment you sell.
A personal thank-you
Buyers hear from your real address, which invites replies.
More repeat buyers
A prompt, friendly note makes people more likely to return.
Works with your shop
Any shop or payment tool that can send a webhook can trigger it.
How it works
What happens, step by step
Your shop sends each new sale to ClickRuntime.
Sales already handled are ignored.
You get a text with the amount and product.
The buyer gets a thank-you email from your Gmail address.
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
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
- 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
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from twilio.rest import Client
import base64
from clickruntime import on_event, credentials, http, state
MY_PHONE = "+447700900123"
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):
raw = base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\n\r\n{text}".encode()).decode()
gmail().messages().send(userId="me", body={"raw": raw}).execute()
@on_event
def handle(event):
s = event.json or {}
sid = str(s.get("id") or event.event_id)
if state.get(f"sale:{sid}"):
return {"skipped": "duplicate"}
sms(MY_PHONE, f"💰 {s.get('amount')} for {s.get('product', 'an order')} from {s.get('email', 'a customer')}")
if s.get("email"):
send_email(s["email"], "Thank you for your order",
f"Hi {s.get('name', 'there')},\n\nThanks for buying {s.get('product', 'from us')}. Reply any time if you have questions.\n\nSam")
state.set(f"sale:{sid}", True)
return {"sale": sid}FAQ
Common questions
Can I write the thank-you myself?
Will test orders trigger it?
Is the same sale ever sent twice?
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
Reply to new leads by text and email within seconds
Every new lead, from a form, a missed call or a voicemail, gets a text and an email within seconds, and you're told about it.
See how it worksAsk for a review after each job by text and email
After each completed job the customer gets a text and email asking for a Google review, and if they reply unhappy you're told straight away.
See how it worksWin 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.
See how it worksKeep exploring
Set up “Get a text for each sale and thank the buyer by email” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.