Daily
Email renewal reminders from your Supabase subscriptions
Every morning, customers whose subscription renews within 7 days get a reminder email, and you get a list of the at-risk ones.
- Runs
- Daily
- Apps
- Gmail, Supabase
- AI
- Optional
- Access
- Supabase read+write; Gmail send
Send this to your assistant
Create a ClickRuntime automation: every morning, find subscriptions in Supabase renewing within 7 days and email each customer a reminder from Gmail, mark them as reminded, and email me a list of the at-risk ones.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Surprise renewals cause refund requests, chargebacks and angry emails. A short reminder a week before is good practice, and in some places a legal requirement, but a small SaaS built on Supabase rarely has a lifecycle email tool set up.
A daily check of upcoming renewals sends each customer one reminder from your Gmail, and flags accounts that look at risk so you can reach out personally before they cancel.
What you get out of it
Fewer surprise charges
Customers know a renewal is coming, which cuts refund requests and chargebacks.
One reminder each
The reminded date is saved on the row, so no one is emailed twice.
A heads-up on churn
You get a list of renewing customers who look at risk, while there's still time to talk to them.
Uses your own data
Works straight from your subscriptions table, no extra email tool needed.
How it works
What happens, step by step
Every morning, ClickRuntime asks Supabase for subscriptions renewing in the next 7 days that haven't been reminded yet.
It emails each customer a reminder with their plan and renewal date from your Gmail address.
It records the reminder date on each row so nobody gets a second email.
You get an email listing renewing customers who haven't logged in recently.
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 Supabase
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
- Run it at a different time, more or less often, or only on weekdays
- 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 Supabase steps into one automation
Under the hood
The code that runs this automation
import base64
from email.message import EmailMessage
from datetime import date, timedelta
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, notify
SUPABASE = "https://your-project.supabase.co/rest/v1"
def sb(method, path, **kw):
key = credentials.secret("SUPABASE_KEY")
r = http.request(method, f"{SUPABASE}/{path}", **kw, headers={"apikey": key, "Authorization": f"Bearer {key}", "Prefer": "return=representation,resolution=merge-duplicates"})
return r.raise_for_status() or (r.json() if r.content else None)
def send(to, subject, text):
msg = EmailMessage()
msg["To"], msg["Subject"] = to, subject
msg.set_content(text)
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()
@on_trigger
def run(event):
today = date.today()
subs = sb("GET", f"subscriptions?renews_at=lte.{today + timedelta(days=7)}&renews_at=gte.{today}&reminded_at=is.null")
for s in subs:
send(s["email"], f"Your {s['plan']} plan renews on {s['renews_at']}",
f"Hi,\n\nA quick note: your {s['plan']} plan renews on {s['renews_at']} for {s['price']}. "
"Nothing to do if you'd like to continue. Reply to this email with any questions.")
sb("PATCH", f"subscriptions?id=eq.{s['id']}", json={"reminded_at": str(today)})
risky = [s for s in subs if not s.get("last_login") or s["last_login"][:10] < str(today - timedelta(days=30))]
if risky:
notify.email_me(f"{len(risky)} renewing customers look at risk",
"\n".join(f"{s['email']} – {s['plan']}, renews {s['renews_at']}, last login {s.get('last_login') or 'never'}" for s in risky))
return {"reminded": len(subs), "at_risk": len(risky)}FAQ
Common questions
What counts as at risk?
Can I change the wording?
Which columns does it use?
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
Find Reddit posts from likely customers and email the best ones
Every hour, Reddit posts about the problem your product solves are scored, saved in Supabase, and the promising ones are emailed to you.
See how it worksSave form leads to Supabase and reply to them by email
Each new lead from your form is checked, scored and saved to Supabase, gets a reply from your Gmail, and you hear about the high-value ones.
See how it worksUpdate stock in Supabase and email a reorder for approval
Each stock movement updates your Supabase inventory table, and when an item falls below its reorder level the manager gets an email with Approve and Reject links.
See how it worksKeep exploring
Set up “Email renewal reminders from your Supabase subscriptions” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.