The moment it happens
Log each sale to a sheet and send a thank-you from Outlook
Every new sale is added to your sales sheet and the buyer gets a personal thank-you email from your Outlook address.
- Runs
- The moment it happens
- Apps
- Google Sheets, Outlook
- AI
- Not needed
- Access
- Sheets edit (only the sheets you pick when connecting); Mail.Send
Send this to your assistant
Create a ClickRuntime automation: when my store sends a new sale, add the buyer, product and amount to my Sales sheet and send the buyer a short thank-you email from my Outlook.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small maker sells through an online store and keeps the books in a Google Sheet. After each order they copy the details across and write a quick thank-you, because customers who hear from a real person come back. On busy weekends neither happens.
Logging each sale and sending the thank-you from the owner's own mailbox keeps the records complete and the personal touch, however busy it gets.
What you get out of it
Records that are always complete
Every sale lands in the sheet with the same columns, ready for bookkeeping.
A personal thank-you
The email comes from your own address, so customers can simply reply to you.
Repeat customers
A friendly note after the first purchase makes people more likely to buy again.
Nothing to do on busy days
Sales on weekends and holidays are handled the same way.
How it works
What happens, step by step
Your store tells ClickRuntime the moment a sale is made.
It checks the sale has not been handled already, so a repeated notice is ignored.
The date, buyer, product and amount are added as a new row in your Sales sheet.
A thank-you email goes to the buyer from your Outlook address.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Outlook
- 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 Google Sheets and Outlook 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 clickruntime import on_event, http, credentials, state, notify
api = lambda name, version: build(name, version, credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
def graph(method, path, **kw):
r = http.request(method, "https://graph.microsoft.com/v1.0" + path, headers={"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}, **kw)
return r.raise_for_status() or (r.json() if r.content else None)
def send_mail(to, subject, text):
graph("POST", "/me/sendMail", json={"message": {"subject": subject, "body": {"contentType": "Text", "content": text},
"toRecipients": [{"emailAddress": {"address": a}} for a in to.split(",")]}})
SHEET_ID = "your-spreadsheet-id"
@on_event
def handle(event):
sale = event.json or {}
if state.get(f"sale:{event.event_id}"):
return {"duplicate": True}
row = [event.received_at[:10], sale.get("name", ""), sale["email"], sale.get("product", ""), sale.get("amount", "")]
api("sheets", "v4").spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Sales!A:E", valueInputOption="USER_ENTERED", body={"values": [row]}).execute()
first = (sale.get("name") or "there").split()[0]
try:
send_mail(sale["email"], f"Thank you for your order, {first}",
f"Hi {first},\n\nThank you for buying {sale.get('product', 'from us')}. If anything isn't right, just reply to this email.\n\nBest wishes,\nSam at Northwind Ceramics")
except Exception as e:
notify.email_me("Thank-you email failed", f"{sale['email']}: {e}")
state.set(f"sale:{event.event_id}", True)
return {"logged": True}FAQ
Common questions
Which stores does this work with?
Can I personalise the email?
What if the email fails?
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
Sort your Outlook inbox with AI and log it to a sheet
New emails get an Outlook category and a one-line summary in a sheet, and simple questions get a reply draft waiting for you.
See how it worksEmail new leads in your sheet from Outlook
Each new lead added to your sheet gets a personal email from your Outlook, and the row is marked as sent with the date.
See how it worksCheck emailed invoices against your purchase order sheet
Invoices arriving in Outlook are read, matched to your purchase orders in a sheet, and anything that doesn't match is flagged to you.
See how it worksKeep exploring
Set up “Log each sale to a sheet and send a thank-you from Outlook” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.