Skip to content

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.

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

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

  1. Your store tells ClickRuntime the moment a sale is made.

  2. It checks the sale has not been handled already, so a repeated notice is ignored.

  3. The date, buyer, product and amount are added as a new row in your Sales sheet.

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

RunsThe moment it happens
Log each sale to a sheet and send a thank-you from Outlookjust nowSucceeded
Google Sheets · Sales19 Oct | Priya at Acme Studio | priya@acme.example | Speckled mug set | £42.00

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 Google Sheets and Outlook 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.
log_each_sale_to_a_sheet_and_email_a_thank_you_from_outlook.pyexample
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?
Any store or payment tool that can send a web request when a sale happens, such as Shopify, Stripe, Gumroad or WooCommerce.
Can I personalise the email?
Yes. Use the buyer's name and product in the template, and write it in your own words.
What if the email fails?
The sale is still logged, and you get an email saying which thank-you did not send.
What permissions does it need?
Sheets edit (only the sheets you pick when connecting); Mail.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 for each event the app sends.
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 “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.