The moment it happens
Reply to inbound emails with AI through SendGrid
Emails sent to your domain get a polite, relevant reply from your own address.
- Runs
- The moment it happens
- Apps
- SendGrid
- AI
- Yes, uses the built-in AI allowance
- Access
- Mail Send
Send this to your assistant
Create a ClickRuntime automation: when SendGrid Inbound Parse posts an email to my link, write a polite reply with AI using our support hours and returns policy below, and send it back via SendGrid from help@example.com.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A shop or small support team sends a lot of the same answers: where is my order, what are your opening hours, do you ship to Canada. Emails land in a shared inbox, and the first reply goes out hours later because the one person who can answer is busy, asleep or on another continent. The customer who asked a two-line question waits a day, then writes again, and the team's inbox doubles with follow-ups that did nothing but ask for a response.
When an inbound email arrives through SendGrid's Inbound Parse, the automation parses the sender, subject and body, has ClickRuntime's built-in AI draft a reply, and sends it back through your SendGrid account. It runs the moment the message arrives, so replies go out within a minute or so. No OpenAI or Anthropic key is required. It fits small teams who want quick acknowledgments and answers to routine questions.
What you get out of it
Customers get an answer in minutes
A prompt, relevant reply keeps a customer from emailing a competitor. For routine questions, speed alone often resolves the issue, and the person does not need to follow up. A question about shipping to Canada answered at 9:02 am often ends a conversation that would otherwise drift to a competitor.
Support staff handle the harder cases
When common questions are answered automatically, humans spend their time on refunds, complaints and unusual requests. The same team can handle more volume without the inbox being a constant source of stress.
Out-of-hours coverage
A question that arrives at 11 pm gets a reply at 11 pm. Customers in other time zones are not left until your morning, which matters for shops that sell internationally.
Consistent tone and information
Replies use the same facts and wording each time, so opening hours or shipping policy are quoted correctly. Different agents improvising answers is a common source of conflicting promises. Return windows and opening hours are quoted identically at 3 am and at noon, whoever is on shift.
Replies leave through your own SendGrid domain
Messages are sent from your authenticated sending domain, so they look like the rest of your mail and benefit from the reputation and tracking you already have in SendGrid. Replies arrive from an address on your authenticated domain, so customers recognize them as yours rather than as unknown automated mail.
How it works
What happens, step by step
When someone emails your domain, SendGrid passes the message to ClickRuntime straight away.
It ignores mail from your own address and from no-reply senders, so it never answers itself or an automated system.
AI reads the subject and message and writes a short, polite reply using the details you give it about your business, without promising anything it doesn't know.
The reply goes back to the sender from your own address through SendGrid, with "Re:" and the original subject.
Before it runs live
- Connect SendGrid
- 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 SendGrid steps into one automation
Under the hood
The code that runs this automation
from email.utils import parseaddr
from clickruntime import on_event, credentials, http, ai
FROM = "hello@northwind.example"
ABOUT = "Northwind sells invoicing software for agencies. Support hours 9–17 UK. Docs: northwind.example/docs"
@on_event
def handle(event):
mail = event.json # Inbound Parse fields: from, subject, text
sender = parseaddr(mail["from"])[1]
if sender.lower() == FROM or "noreply" in sender.lower():
return {"skipped": True}
reply = ai.generate(f"Subject: {mail['subject']}\n\n{mail.get('text', '')[:4000]}",
system=f"Write a short, polite reply on behalf of: {ABOUT} Don't promise anything you don't know.", max_output_tokens=300).text
http.post("https://api.sendgrid.com/v3/mail/send", headers={"Authorization": f"Bearer {credentials.secret('SENDGRID_API_KEY')}"},
json={"personalizations": [{"to": [{"email": sender}]}], "from": {"email": FROM, "name": "Northwind"},
"subject": f"Re: {mail['subject']}", "content": [{"type": "text/plain", "value": reply}]}).raise_for_status()
return {"replied": sender}FAQ
Common questions
What do I need to set up in SendGrid for inbound email?
Will the AI reply to every email, including spam?
Can the AI use my own policies and product details?
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
Add new sign-ups to a SendGrid list
Everyone who fills in your sign-up form ends up in your SendGrid contacts and newsletter list.
See how it worksGet told when emails bounce or are marked as spam
Bounces, dropped emails and spam complaints are posted with the address and reason, grouped so one bad batch doesn't flood the channel.
See how it worksEmail a daily report to a list through SendGrid
A summary of the numbers or news you track goes out from your own domain at the same time each day.
See how it worksKeep exploring
Set up “Reply to inbound emails with AI through SendGrid” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.