The moment it happens
Follow up new leads by email and WhatsApp within minutes
Each new lead gets a personal email and a WhatsApp message within minutes, written around what they asked.
- Runs
- The moment it happens
- Apps
- Gmail, WhatsApp Business
- AI
- Yes, uses the built-in AI allowance
- Access
- Gmail send+read; WhatsApp messaging
Send this to your assistant
Create a ClickRuntime automation: when a new lead comes in from my form, write a short personal reply based on their message, email it from my Gmail, send my WhatsApp intro template, and remember the lead.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Leads go cold fast. A prospect who filled in a form on a Friday evening and hears nothing until Monday has usually spoken to two competitors by then.
A personal email that responds to what they actually asked, plus a WhatsApp message they'll see on their phone, makes the first contact within minutes and starts the conversation on the channel they prefer.
What you get out of it
First to reply
Leads hear from you in minutes, day or night.
Personal, not generic
The email picks up on what the lead wrote, so it reads like a real reply.
Two ways to respond
Leads can reply by email or WhatsApp, whichever suits them.
A list of every lead
Each lead is remembered with the time they were contacted.
How it works
What happens, step by step
Your lead form sends each new lead to ClickRuntime.
AI writes a short, personal email reply based on what they asked.
The email is sent from your Gmail, and your WhatsApp intro template goes to their phone if they gave a number.
The lead and contact time are remembered so they aren't contacted twice.
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 WhatsApp Business
- 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 WhatsApp Business steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import base64, time
from clickruntime import on_event, credentials, http, state, ai
WA = "https://graph.facebook.com/v20.0/your-phone-number-id/messages"
def wa_template(to, name, params):
body = {"messaging_product": "whatsapp", "to": to, "type": "template", "template": {"name": name, "language": {"code": "en"},
"components": [{"type": "body", "parameters": [{"type": "text", "text": str(p)} for p in params]}]}}
return http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"}, json=body).json()
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
def send_email(to, subject, text):
raw = base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\n\r\n{text}".encode()).decode()
gmail().messages().send(userId="me", body={"raw": raw}).execute()
@on_event
def handle(event):
lead = event.json or {}
email, name = lead.get("email", ""), lead.get("name", "there")
if "@" not in email or state.get(f"lead:{email}"):
return {"skipped": True}
body = ai.generate(f"Lead {name} wrote: {lead.get('message', '')[:1500]}", max_output_tokens=250,
system="Write a friendly 4-sentence reply from a small business owner. Offer a short call. No sign-off.").text
send_email(email, f"Re: your enquiry, {name}", f"{body.strip()}\n\nBest,\nAlex")
if lead.get("phone"):
wa_template(lead["phone"], "lead_intro", [name])
state.set(f"lead:{email}", {"at": time.time(), "phone": lead.get("phone")})
return {"lead": email}FAQ
Common questions
Can I check emails before they go?
What does the WhatsApp message say?
What if the lead didn't give a phone number?
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
Answer customers on WhatsApp and email you what the bot can't
Customers get an instant answer on WhatsApp, and anything the bot can't handle is emailed to you with the conversation.
See how it worksGet critical alerts by email and WhatsApp
When one of your systems reports a failure, you get an email and a WhatsApp message, without repeats for the same problem.
See how it worksGet each new Stripe sale by email and WhatsApp
Every completed Stripe checkout sends you an email with the details and a WhatsApp message with the amount.
See how it worksKeep exploring
Set up “Follow up new leads by email and WhatsApp within minutes” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.