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.
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
Every few minutes ClickRuntime checks your Gmail for new enquiry emails.
AI reads each one, gives it a score and writes a short, personal first reply.
The reply is sent from your Gmail, and the email is labelled so it is never answered twice.
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
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 Telegram steps into one automation
Under the hood
The code that runs this automation
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?
How is a lead scored?
Can I review replies before they go?
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
Sort your inbox with AI and get urgent emails on Telegram
New emails are labelled and newsletters archived for you, and only the urgent ones reach your phone as a Telegram message.
See how it worksAnswer support emails from your FAQ and escalate the rest to Telegram
Routine support questions get a reply from your FAQ within minutes, and anything the AI is unsure about is sent to you on Telegram instead.
See how it worksApprove supplier invoices from Telegram
Each supplier invoice email is sent to your Telegram with supplier, amount and due date, and replying 'ok' marks it Approved in Gmail.
See how it worksKeep exploring
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.