Skip to content

Every 5 minutes

Reply to new lead emails fast and get a Telegram ping

Each new lead email gets a personal first reply within minutes, and you get a Telegram message with the lead and how promising it looks.

Runs
Every 5 minutes
Apps
Gmail, Telegram
AI
Yes, uses the built-in AI allowance
Access
Gmail gmail.modify; Telegram bot token

Send this to your assistant

Create a ClickRuntime automation: when a lead email arrives, score it, send a personalised first reply, and message me on Telegram with the lead and score.

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 studio gets enquiries through its contact address. The owner is often on site with clients, and enquiries sit for hours. By the time she replies, some leads have already booked with whoever answered first.

This automation answers each new enquiry within minutes with a reply that refers to what the person asked, and pings you on Telegram with a quick score so you know which leads to call back first.

What you get out of it

  • First to reply, more often

    People who send enquiries to several businesses tend to go with the first useful answer. A fast reply keeps you in the running.

  • Replies that mention their request

    The reply refers to what the person actually asked, which reads as attention rather than an autoresponder.

  • Know which leads to call first

    The score and one-line summary on Telegram let you decide between meetings who deserves a call today.

  • Your inbox stays the record

    Replies are sent from your own Gmail in the same thread, so the whole conversation is where you expect it.

How it works

What happens, step by step

  1. Every few minutes ClickRuntime checks your Gmail for new enquiry emails.

  2. AI reads each one, gives it a score and writes a short, personal first reply.

  3. The reply is sent from your Gmail, and the email is labelled so it is never answered twice.

  4. You get a Telegram message with the sender, a one-line summary and the score.

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 Telegram

What you get

RunsEvery 5 minutes
Reply to new lead emails fast and get a Telegram pingtoday, 9:00Succeeded
Telegram · LeadsNew lead (8/10): Acme Dental. Wants a full website rebuild before March, budget mentioned.

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
  • 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 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.
instant_lead_replies_with_a_telegram_ping.pyexample
import base64
from email.mime.text import MIMEText
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, report_fetched

CHAT_ID, LABEL_ID = "your-telegram-chat-id", "Label_LeadReplied"
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "summary": {"type": "string"}, "reply": {"type": "string"}}}

@on_trigger
def run(event):
    gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    msgs = gmail.users().messages().list(userId="me", q="to:hello@northwind.example -label:LeadReplied newer_than:1d").execute().get("messages", [])
    report_fetched(len(msgs))
    if not msgs:
        return {"leads": 0}
    token = credentials.secret("TELEGRAM_BOT_TOKEN")
    for m in msgs:
        msg = gmail.users().messages().get(userId="me", id=m["id"], format="metadata").execute()
        hdr = {h["name"]: h["value"] for h in msg["payload"]["headers"]}
        out = ai.generate(f"Lead email:\n{msg['snippet']}\nScore 1-10 for fit, summarise in one line, write a friendly first reply.",
                          json_schema=SCHEMA, max_output_tokens=500).json
        mime = MIMEText(out["reply"]); mime["To"] = hdr["From"]; mime["Subject"] = "Re: " + hdr.get("Subject", "")
        gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(mime.as_bytes()).decode(), "threadId": msg["threadId"]}).execute()
        gmail.users().messages().modify(userId="me", id=m["id"], body={"addLabelIds": [LABEL_ID]}).execute()
        http.post(f"https://api.telegram.org/bot{token}/sendMessage",
                  json={"chat_id": CHAT_ID, "text": f"New lead ({out['score']}/10): {hdr['From']}\n{out['summary']}"})
    return {"leads": len(msgs)}

FAQ

Common questions

Which emails count as leads?
Emails sent to your enquiries address or with a label you choose. Newsletters, receipts and replies to existing threads are left alone.
How is a lead scored?
AI rates each enquiry from 1 to 10 using what you care about, such as budget, timing and fit, and gives a one-line reason.
Can I review replies before they go?
Yes. It can save the reply as a Gmail draft and still ping you on Telegram, so you send it with one tap.
What permissions does it need?
Gmail gmail.modify; Telegram bot token. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new 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 “Reply to new lead emails fast and get a Telegram ping” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.