Daily
Remind customers on Telegram before their subscription ends
Every morning, customers whose subscription ends in 3 days get a Telegram reminder, and each one is marked so it's only sent once.
- Runs
- Daily
- Apps
- Supabase, Telegram
- AI
- Not needed
- Access
- Supabase read+write; bot token (users must have started the bot)
Send this to your assistant
Create a ClickRuntime automation: every morning, find Supabase subscriptions expiring in 3 days that have a Telegram chat ID, message each customer a renewal reminder, mark it as sent, and email me a summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Services that sell through Telegram, such as signal groups, courses or communities, lose members simply because they forget to renew. An email reminder goes unread; a Telegram message where they already spend their time gets seen.
A daily check for subscriptions ending soon, with a personal message on Telegram, keeps renewals up without anyone chasing members by hand.
What you get out of it
More renewals
A timely nudge where members already are catches people who meant to renew.
Personal messages
Each reminder uses the member's name, plan and end date.
Sent once
Each row is marked when reminded, so members aren't messaged repeatedly.
A daily summary
You get an email listing who was reminded.
How it works
What happens, step by step
Every morning, ClickRuntime asks Supabase for subscriptions ending in 3 days that haven't been reminded.
It sends each customer a Telegram message with their plan and end date.
It marks each row as reminded so the message is only sent once.
You get an email summary of reminders sent and any that failed.
Before it runs live
- Connect Supabase
- Connect Telegram
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
- 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 Supabase and Telegram steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
RENEW_URL = "https://northwind.example/renew"
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 tg(method, **params):
return http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=params).json()
@on_trigger
def run(event):
day = date.today() + timedelta(days=3)
subs = sb("GET", f"subscriptions?expires_on=eq.{day}&reminder_sent=is.false&chat_id=not.is.null")
sent, failed = [], []
for s in subs:
r = tg("sendMessage", chat_id=s["chat_id"], text=f"Hi {s['name']}, your {s['plan']} subscription ends on {day:%d %B}. "
f"Renew here to keep access: {RENEW_URL}")
if r.get("ok"):
sb("PATCH", f"subscriptions?id=eq.{s['id']}", json={"reminder_sent": True})
sent.append(s["name"])
else:
failed.append(f"{s['name']}: {r.get('description')}")
if subs:
notify.email_me(f"Renewal reminders: {len(sent)} sent, {len(failed)} failed", "\n".join(["Sent: " + ", ".join(sent)] + failed))
return {"sent": len(sent), "failed": len(failed)}FAQ
Common questions
Can the bot message any customer?
Can I include a renewal link?
What if a message 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
Send new feed posts to Telegram, never twice
Every new post from a feed you follow is saved in Supabase and sent to your Telegram channel exactly once.
See how it worksAdd and list Supabase records from Telegram commands
You type /add, /list or /delete to your Telegram bot and the matching rows in your Supabase table are created, shown or removed.
See how it worksCheck form sign-ups, save them to Supabase and ping Telegram
Each customer your form sends is checked, saved to Supabase unless they already exist, and you get a Telegram message either way.
See how it worksKeep exploring
Set up “Remind customers on Telegram before their subscription ends” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.