Send new email contents to intake endpoint for processing
Every new email to your support inbox is sent as structured data to your intake system, so it can become a ticket without anyone copying it by hand.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/send-new-email-contents-to-intake-endpoint-for-processing/
Paste into Claude, ChatGPT, Cursor or any agent.
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/send-new-email-contents-to-intake-endpoint-for-processing
Set it up with the CLI
- Add it. Copies the folder into
zaps/send-new-email-contents-to-intake-endpoint-for-processing/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/send-new-email-contents-to-intake-endpoint-for-processing - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy send-new-email-contents-to-intake-endpoint-for-processing - Check it. Its recent runs, with status and errors.
npx zap-pack logs send-new-email-contents-to-intake-endpoint-for-processing
zaps/send-new-email-contents-to-intake-endpoint-for-processing/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/gmail.tsThe
gmailaccount it uses - triggers/message.tsWhat starts it:
gmailmessage - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: Gmail, New Email (
gmail,message). Each new message fires a run with its subject, plain-text body, sender and message ID. - Filter (built as code, not a step): optional keyword and sender filters. Both are empty by default, so every email is forwarded.
- Webhooks by Zapier, POST: sends JSON
{ subject, message, sender, message_id }to your intake endpoint. The subject maps tosubject, the plain body tomessage, and the sender address tosender.
The Zap only forwards. Its one action is that POST, and nothing is written back to Gmail.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
REPLACE_INTAKE_ENDPOINT_URL |
The URL of the intake endpoint (config.ts). It must accept a JSON POST with subject, message, sender and message_id. Use a test endpoint for the first run. |
Also review the defaults with them:
- Mailbox: the trigger watches the Gmail Inbox (
label_ids: "INBOX", set in step 2 of Build it). Left unset, it fires on every email, including drafts. ROUTING_KEYWORDS(inworkflow.ts): optional. Forward only emails containing one of these words. Empty forwards every email.MONITORED_SENDERS(inworkflow.ts): optional. Forward only emails from these addresses. Empty forwards from any sender.
Questions to settle: which Gmail account receives the inbox to be processed, and whether only some emails should go through (and if so, which keywords or sender addresses).
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/send-new-email-contents-to-intake-endpoint-for-processing, replace each REPLACE_… value as this file says, then run npx zap-pack deploy send-new-email-contents-to-intake-endpoint-for-processing, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
gmailto the user's Gmail connection for the account that receives the inbox to be processed. Webhooks by Zapier needs no connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/message.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them, and set the trigger's mailbox to Inbox (label_ids: "INBOX"). The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run this sample as a draft test run (run_workflow_draft in Zapier MCP) before publishing. Point REPLACE_INTAKE_ENDPOINT_URL at a test endpoint first, not the production intake:
{
"subject": "[install-test] Sample support request",
"body_plain": "[install-test] Sample body: my order has not arrived.",
"from": {
"email": "install-test-sender@example.com",
"name": "Install Test"
},
"message_id": "install-test-msg-001"
}
Check that the run completes, and that the endpoint receives a JSON body whose subject, message, sender and message_id match the sample. Read the body back from the run's step result (get_run_output with include_results: true), not from the run status alone. If run-status tools aren't available, check the result in your intake endpoint directly. Ask the user to delete the test data; the agent doesn't. Then publish, confirm the trigger is active, and note that nothing fires until the Gmail trigger sees mail.
Notes
- Deduplication by Message-ID is not built: a durable workflow has no store of past IDs. Gmail does not re-deliver the same message, but a retry of a failed POST can send it twice.
fromarrives as an object ({ name, email }), and the workflow readsemail. A plain string is handled too.- The POST sends the email body as-is, so use an endpoint you trust, over HTTPS. Don't commit a real intake endpoint URL; anyone with it can submit tickets.
- To customize: strip signatures or pull out order numbers with a Formatter step or plain JavaScript before the POST, or route by subject to different endpoints with separate POST steps or a
switch.