The moment it happens
Reply to new leads by text and email within seconds
Every new lead, from a form, a missed call or a voicemail, gets a text and an email within seconds, and you're told about it.
- Runs
- The moment it happens
- Apps
- Gmail, Twilio
- AI
- Optional
- Access
- Twilio account SID/token; gmail.send
Send this to your assistant
Create a ClickRuntime automation: when a new lead comes in from my form or a missed call, text them and email them a short personal reply from my Gmail, and email me a heads-up.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Leads come in from all directions: web forms, calls you couldn't take, voicemails. Each one is someone ready to talk right now, and every hour without a reply makes a sale less likely.
Replying within seconds by both text and email reaches the lead however they prefer, and a heads-up to you means you can follow up personally as soon as you're free.
What you get out of it
Seconds, not hours
Every lead hears from you almost immediately.
Reach them both ways
A text gets noticed; an email holds the detail and your signature.
Every source covered
Form leads and missed calls get the same quick reply.
You're in the loop
A heads-up email tells you who to call next.
How it works
What happens, step by step
A new lead arrives from your form, or Twilio reports a missed call.
Leads already contacted this week are skipped.
A short reply is written, optionally personalised by AI from their message.
The lead gets a text and an email from your Gmail, and you get a heads-up email.
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 Twilio
- Paste your automation's link into the other app's webhook settings
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 Twilio steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from twilio.rest import Client
import base64, time
from clickruntime import on_event, credentials, http, state, ai, notify
FROM = "+15005550006"
def sms(to, body):
return Client(credentials.secret("TWILIO_ACCOUNT_SID"), credentials.secret("TWILIO_AUTH_TOKEN")).messages.create(to=to, from_=FROM, body=body)
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
def send_email(to, subject, text):
gmail().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\n\r\n{text}".encode()).decode()}).execute()
@on_event
def handle(event):
f = event.json or {}
phone = f.get("phone") or (f.get("From") if f.get("CallStatus") in ("no-answer", "busy") else None)
email, name = f.get("email"), f.get("name", "there")
key = f"lead:{phone or email}"
if not (phone or email) or time.time() - (state.get(key) or 0) < 7 * 86400:
return {"skipped": True}
text = f"Hi {name}, thanks for getting in touch with Northwind Electrical. We'll call you shortly."
if f.get("message"):
text = ai.generate(f["message"][:800], system=f"Write a 2-sentence friendly reply to {name} from Northwind Electrical.", max_output_tokens=80).text.strip()
if phone: sms(phone, text)
if email: send_email(email, "Thanks for getting in touch", text)
notify.email_me(f"New lead: {name}", f"Phone: {phone}\nEmail: {email}\n{f.get('message', '')}")
state.set(key, time.time())
return {"lead": phone or email}FAQ
Common questions
Can AI personalise the message?
What if there's no email address?
Will leads be contacted twice?
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
Get a text for each sale and thank the buyer by email
Each new sale sends you a text with the amount and the buyer a thank-you email from your Gmail.
See how it worksAsk for a review after each job by text and email
After each completed job the customer gets a text and email asking for a Google review, and if they reply unhappy you're told straight away.
See how it worksConfirm appointments, remind clients and rebook no-shows
Clients get an email and text confirming their appointment, a reminder the day before, and a rebooking message if they don't turn up.
See how it worksKeep exploring
Set up “Reply to new leads by text and email within seconds” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.