Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. When someone emails your domain, SendGrid passes the message to ClickRuntime straight away.

  2. It ignores mail from your own address and from no-reply senders, so it never answers itself or an automated system.

  3. 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.

  4. 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

RunsThe moment it happens
Reply to inbound emails with AI through SendGridjust nowSucceeded
Email · Re: Can I export to CSV?Hi Riley, yes – every report has an Export button that downloads a CSV. Steps are at northwind.example/docs/export.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
ai_auto_reply_to_inbound_emails.pyexample
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?
Inbound Parse requires an MX record for a subdomain pointing at SendGrid, and a Parse webhook set to the link ClickRuntime gives you. SendGrid then posts each received email to the automation as a form submission.
Will the AI reply to every email, including spam?
Without a filter, yes. It is wise to add conditions, such as ignoring no-reply senders or messages containing certain phrases, and to ask the AI to answer only when it is confident. Edge cases can be forwarded to a person.
Can the AI use my own policies and product details?
Yes. You can give it your shipping policy, return rules and opening hours as instructions, and it will draw on them in replies. Anything it is not told, it should be instructed to hand to a human.
What permissions does it need?
Mail Send. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.