Skip to content

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.

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

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

  1. Every morning, ClickRuntime asks Supabase for subscriptions ending in 3 days that haven't been reminded.

  2. It sends each customer a Telegram message with their plan and end date.

  3. It marks each row as reminded so the message is only sent once.

  4. You get an email summary of reminders sent and any that failed.

Before it runs live

  • Connect Supabase
  • Connect Telegram

What you get

RunsDaily
Remind customers on Telegram before their subscription endstoday, 9:00Succeeded
Telegram · Northwind botHi Jordan, your Pro subscription ends on 22 October. Renew here to keep access: northwind.example/renew

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

  • 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

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.
scheduled_per_user_reminders_from_supabase_rows.pyexample
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?
Only people who've started a chat with your bot. Their chat ID needs to be stored in the subscriptions table.
Can I include a renewal link?
Yes. Add the link to the message, or a per-customer link from a column in the table.
What if a message fails?
The row isn't marked, so it's tried again the next morning, and the failure is listed in your summary.
What permissions does it need?
Supabase read+write; bot token (users must have started the bot). 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 each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
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 “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.