The moment it happens
Forward WhatsApp Business messages to Gmail
Each message a customer sends to your WhatsApp Business number is emailed from your Gmail to a chosen inbox, with the sender's name and number in the subject.
- Runs
- The moment it happens
- Apps
- Gmail, WhatsApp Business
- AI
- Not needed
- Access
- WhatsApp messaging webhook; Gmail send
Send this to your assistant
Create a ClickRuntime automation: when a customer messages my WhatsApp Business number, email the message from my Gmail to support@mycompany.com with their name and number in the subject, keeping each customer in one email thread.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
When customers write on WhatsApp, the messages usually land on one phone or one person's WhatsApp Business login. The rest of the support team works in email and never sees them.
This sends a copy of every incoming WhatsApp message to a shared inbox from your Gmail account. Messages from the same customer stay together in one email thread, with their name and number in the subject.
It suits small shops, clinics, tradespeople and support teams who take orders and questions on WhatsApp but track their work in email.
What you get out of it
One inbox for every channel
WhatsApp questions sit next to email questions, so nobody has to check a separate phone to know what customers are asking.
Threads per customer
Every message from the same number joins one thread. The full conversation is easy to read in order.
Searchable record
Email search finds an order number or a complaint months later. WhatsApp alone is much harder to search across customers.
Nothing changes for customers
Customers keep using WhatsApp as before. The copy to email happens in the background.
Works with your Gmail rules
Labels, filters and shared inboxes you already use in Gmail apply to these emails too.
How it works
What happens, step by step
WhatsApp sends ClickRuntime each incoming message on your business number.
ClickRuntime reads the customer's name, number and message. Photos and documents are noted with their caption.
The message is emailed from your Gmail to the inbox you choose, with the name and number in the subject.
Later messages from the same customer go into the same email thread.
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
- 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 Gmail and WhatsApp Business steps into one automation
Under the hood
The code that runs this automation
import base64
from email.message import EmailMessage
from datetime import datetime
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, state
TO = "support@mycompany.com"
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
def incoming(event):
for e in (event.json or {}).get("entry", []):
for c in e.get("changes", []):
v = c["value"]
names = {x["wa_id"]: x["profile"]["name"] for x in v.get("contacts", [])}
for m in v.get("messages", []):
yield m, names.get(m["from"], "")
@on_event
def handle(event):
sent = 0
for m, name in incoming(event):
t = m["type"]
text = m["text"]["body"] if t == "text" else f"[{t}] " + (m.get(t, {}).get("caption") or "(no caption, open WhatsApp to view)")
subject = f"WhatsApp from {name or 'customer'} (+{m['from']})"
msg = EmailMessage()
msg["To"], msg["Subject"] = TO, subject
msg.set_content(f"{text}\n\nReceived on WhatsApp at {datetime.fromtimestamp(int(m['timestamp'])):%H:%M}.")
body = {"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}
thread = state.get(f"thread:{m['from']}")
if thread:
body["threadId"] = thread
res = gmail().messages().send(userId="me", body=body).execute()
state.set(f"thread:{m['from']}", res["threadId"])
sent += 1
return {"forwarded": sent}FAQ
Common questions
Does the customer see anything different on WhatsApp?
What happens with photos and voice notes?
How do I set it up in Meta?
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 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 worksAnswer 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 worksKeep exploring
Set up “Forward WhatsApp Business messages to Gmail” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.