Email Triggers (Mailhooks)
An email trigger gives you a unique address like k3f9a2b1c7d8e9@mailhook.serenitiesai.com. Any email sent — or forwarded — to that address runs a flow, an AI agent, or a function, with the email’s sender, subject, message and attachments as input. Create them in Automations → Triggers, or just ask the AI.
Everything is instant — the moment an email arrives, your automation runs. There is no inbox to poll and nothing to refresh. Auto-replies, bounces and duplicate deliveries are filtered out for you, so your automation only ever sees real email.
What can you build with it?
- Support inbox — forward support@yourdomain to a hook; an AI agent reads each email, files a ticket, drafts an answer.
- Invoice intake — suppliers email invoices straight into a table, attachments included.
- Lead capture — your website form provider emails every submission; a flow turns each one into a CRM record.
- Watch your own inbox — add a Gmail/Outlook forwarding rule for matching emails, and your automation reacts to your real mailbox — no account connection needed.
A complete email conversation (AI auto-reply)
The full loop — a customer emails you, your AI agent answers from your real address, and every reply keeps the conversation going:
- Create an email trigger that asks an AI agent (Automations → Triggers).
- Give the agent sending power: grant it the email capability, and connect a sending account (your own mailbox) under Automations → Email so replies come from your real address — not a do-not-reply one.
- Route replies back: instruct the agent to send with
replyToset to its trigger address — when the customer hits Reply, the answer flows straight back into the trigger and the agent responds again. Alternatively, add a forwarding rule in your sending mailbox that forwards replies to the trigger address. - Context carries itself: each reply contains the quoted conversation, so the agent reads the full history every round. Nothing is stored on our side beyond the trigger’s activity log.
Forwarding from Gmail or Outlook
- Copy your trigger’s address from Automations → Triggers.
- In Gmail: Settings → Forwarding → add the address. Gmail sends a confirmation to the trigger itself — it appears in the trigger’s Recent emails marked action needed, with the code and an “Approve forwarding” link ready to click.
- Add a Gmail filter so only matching email (e.g. replies, or one sender) is forwarded — not your whole inbox.
What your function receives
// params on an email-triggered run:
const { email } = params; // params.source === 'mailhook'
email.from.address; // who sent it
email.subject; email.text; // subject + plain-text body (html also available)
email.attachments; // [{ fileName, contentType, size, content? }]
email.auth; // { spf, dkim, dmarc } — sender verification results
await ctx.tables.createRow('Support Tickets', {
From: email.from.address,
Subject: email.subject,
Message: email.text,
});Flows receive the same fields as trigger data, and AI agents receive the email as the task input. To reply, use your own connected mailbox (ctx.email.sendVia) — the trigger address only receives.
Treat email content as data, not instructions. Anyone who knows the address can email it — that’s what makes it useful. The address is unguessable, but never let an email’s sender name grant special powers unless the verification results (email.auth) say the sender is genuine.
Received volume is part of your plan’s monthly allowance; the number of triggers you can create is unlimited. Pause or delete a trigger any time — its address stops accepting mail within seconds.