The moment it happens
Ask cancelling customers why, and get a weekly churn summary
Customers who cancel get one personal question by email, their replies are sorted by reason, and you get a weekly summary.
- Runs
- The moment it happens
- Apps
- Gmail, Stripe
- AI
- Yes, uses the built-in AI allowance
- Access
- Stripe read; gmail.modify
Send this to your assistant
Create a ClickRuntime automation: when a Stripe subscription is cancelled, email the customer from Gmail asking why they left; classify their replies with AI and send me a weekly churn summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A subscription app loses a few dozen customers a month. Stripe records that they cancelled but not why, and the in-app cancellation form gets skipped. The founder has a guess (price, a missing feature, a competitor), but no evidence, so the roadmap is shaped by whoever complained loudest.
This automation sends every cancelling customer one short, personal question from the founder's Gmail. People reply to a plain email far more readily than to a survey. The replies are read and sorted into reasons such as price, missing feature or switched tool, and once a week a summary lands in the inbox showing what is actually driving churn.
What you get out of it
Real reasons, not guesses
Customers say in their own words why they left, and those answers are collected in one place.
Higher reply rates
A one-line question from a person's address gets more answers than a form or survey link.
Reasons sorted for you
AI groups replies into a few categories, so trends are visible without reading every email.
A weekly view of churn
One summary email each week shows counts by reason and a few representative quotes.
Chances to win customers back
Some replies describe a fixable problem, and you see them while there is still time to respond.
How it works
What happens, step by step
When a subscription is cancelled, Stripe tells ClickRuntime straight away, and the message is checked to be genuinely from Stripe.
The customer is emailed one short question from your Gmail, and the conversation is remembered.
Each day, ClickRuntime checks those conversations for replies, and AI sorts each new reply into a reason.
Once a week, you get an email with the number of cancellations by reason and a few quotes.
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 Stripe
- 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
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Gmail and Stripe steps into one automation
Under the hood
The code that runs this automation
import base64, stripe, time
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, on_trigger, credentials, verify, state, ai, notify, report_fetched
@on_event
def handle(event):
if not verify.stripe(event.body, event.header("Stripe-Signature"), credentials.secret("STRIPE_WEBHOOK_SECRET")):
return {"ignored": "bad signature"}
email = stripe.Customer.retrieve(event.json["data"]["object"]["customer"], api_key=credentials.secret("STRIPE_API_KEY")).email
msg = EmailMessage(); msg["To"], msg["Subject"] = email, "Quick question"
msg.set_content("Sorry to see you go. What was the main reason you cancelled? A one-line reply is plenty.")
build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users().messages().send(
userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
state.set("asked", (state.get("asked") or []) + [email])
return {"asked": email}
@on_trigger
def check(event):
g = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users().messages()
replies = [m for e in state.get("asked") or [] for m in g.list(userId="me", q=f"from:{e} newer_than:1d").execute().get("messages", [])[:1]]
report_fetched(len(replies))
if not replies:
return {"replies": 0}
reasons = (state.get("reasons") or []) + [ai.generate("Classify this cancellation reply as price, missing feature, switched tool, no longer needed, technical problems or other. "
"Answer with the category only.\n" + g.get(userId="me", id=m["id"]).execute()["snippet"], max_output_tokens=10).text.strip() for m in replies]
if time.gmtime().tm_wday == 0:
notify.email_me("Weekly churn reasons", "\n".join(f"{r}: {reasons.count(r)}" for r in sorted(set(reasons)))); reasons = []
state.set("reasons", reasons)
return {"replies": len(replies)}FAQ
Common questions
What does the customer receive?
Which reasons does it sort into?
What if they don't reply?
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
Email buyers their product and receipt after a Stripe payment
As soon as someone pays, they get their download link and a receipt from your own Gmail address.
See how it worksCheck VAT numbers on Stripe invoices and email the right person
When Stripe drafts an invoice, an invalid VAT number is flagged to finance; when it's finalised, the customer gets an email from you.
See how it worksWin back failed payments with a friendly email
When a card fails, the customer gets a short note from you with a link to pay, and a reminder three days later if it's still unpaid.
See how it worksKeep exploring
Set up “Ask cancelling customers why, and get a weekly churn summary” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.