Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Send and receive emails using the Resend API. Use for: (1) sending emails directly via Resend API, (2) receiving email notifications via cron, (3) drafting r...
Send and receive emails using the Resend API. Use for: (1) sending emails directly via Resend API, (2) receiving email notifications via cron, (3) drafting r...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
Apache License 2.0 โ See LICENSE file for full text.
Send and receive emails using the Resend API.
No config file needed. The skill auto-discovers settings from: Environment variables โ RESEND_API_KEY (required), DEFAULT_FROM_EMAIL/NAME (optional) Preferences file โ memory/email-preferences.md (from_email, from_name, telegram target) OpenClaw context โ channel, chat_id, thread_id (for cron delivery)
export RESEND_API_KEY="re_123456789" # Resend API key (required) # DEFAULT_FROM_EMAIL and DEFAULT_FROM_NAME are optional - loaded from preferences file if not set
The skill reads sender info from memory/email-preferences.md: --- from_email: you@company.com from_name: Your Name telegram: target: "CHAT_ID" threadId: "THREAD_ID" --- Scripts check env vars first, then fall back to preferences file.
FieldSourceExampleuser.emailUSER.mdyou@company.comuser.nameUSER.mdYour NamechannelOpenClawfrom contextchat_idOpenClaw123456789thread_idOpenClaw334 The skill uses these directly from OpenClaw context โ no parsing needed.
There are two ways to configure the cron: Option 1: Static (Hardcoded Target) Use this if you always want the same delivery target: openclaw cron add \ --name "email-resend-inbound" \ --cron "*/15 * * * *" \ --message "Follow instructions in skills/email-resend/cron-prompts/email-inbound.md exactly. If new emails found, include them in your reply." \ --session isolated \ --announce \ --channel telegram \ --to "-1003748898773:topic:334" Option 2: Dynamic (From Preferences) โ Recommended This reads your notification preferences from memory/email-preferences.md and configures the cron automatically. Run: python3 ~/.openclaw/workspace/skills/email-resend/scripts/configure-cron.py What it does: Reads memory/email-preferences.md for your telegram target/threadId Deletes any existing email-resend-inbound cron Creates a new cron with your preferred delivery target First-time setup: If preferences don't exist, it will tell you what to configure. Parameters: --schedule "cron */15 * * * *" โ Run every 15 minutes --session isolated โ Required for agentTurn payloads --announce โ Enable delivery of results to chat --channel telegram โ Delivery channel --to โ Telegram target (format: chat_id:topic:thread_id) Note: The cron prompt reads notification preferences from memory/email-preferences.md. On first run, if preferences are missing, it will ask you for: Which channel for notifications (telegram, discord, etc.) Chat ID and Thread ID (for topics)
python3 ~/.openclaw/workspace/skills/email-resend/scripts/inbound.py
Each new email triggers a notification with: From, Subject, Date Body preview (~2000 chars) Attachment list (if any) Importance: ๐ฅ HIGH / ๐ MEETING / ๐ฌ NORMAL
NEVER auto-acknowledge emails. Only the user can acknowledge by: Replying to the notification message, OR Typing: done / ack Emails must remain in pending state until user explicitly acknowledges. Use draft-reply.py to compose replies with proper quoting. Important: Always use inline replies ([[reply_to_current]]) to keep messages linked in the thread. This enables: Proper custody chain tracking Reply-to-email tracing Better conversation flow CRITICAL: When responding via OpenClaw message tool, use replyTo parameter (not [[reply_to_current]] tag): message(action="send", channel="<from-context>", replyTo="<msg_id>", ...)
ScriptPurposeinbound.pyCheck emails, send notificationsdraft-reply.pyDraft reply workflow with quoting & threadingoutbound.pySend emails directlydownload_attachment.pyDownload attachments from inbound emails
To download attachments from an inbound email: # List attachments (shows IDs) python3 scripts/download_attachment.py <email_id> --list # Download all to directory python3 scripts/download_attachment.py <email_id> --output-dir ./attachments # Download specific attachment python3 scripts/download_attachment.py <email_id> --attachment-id <attachment_id> Note: The API path is /emails/receiving/{email_id}/attachments (not the standard /emails/ path).
memory/email-resend-inbound-notified.json โ pending/acknowledged emails memory/email-message-map.json โ notification message_id โ email_id (legacy) memory/email-custody-chain.json โ Full DAG of email โ notification โ actions memory/email-msg-to-chain.json โ notification message_id โ chain lookup memory/email-draft-state.json โ Active draft state (email_id, status, reply_content) See docs/custody-chain.md for DAG design.
python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \ --to "recipient@example.com" \ --subject "Hello" \ --body "Message text" # With attachments python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \ --to "recipient@example.com" \ --subject "Here's the file" \ --body "See attachment" \ --attachment ./file.pdf \ --attachment ./image.png
MANDATORY: Always use draft-reply.py for replying to emails. This is non-negotiable. Failure to follow this rule will result in broken Gmail threading.
Gmail threads emails based on In-Reply-To AND References headers Using wrong headers = reply appears as NEW thread = context lost There's no way to fix this after sending
# Step 1: Start draft (fetches Message-ID automatically) python3 ~/.openclaw/workspace/skills/email-resend/scripts/draft-reply.py start <email_id> # Step 2: Set reply content python3 ~/.openclaw/workspace/skills/email-resend/scripts/draft-reply.py content "Your reply" # Step 3: Send python3 ~/.openclaw/workspace/skills/email-resend/scripts/draft-reply.py send
When user approves a draft, you MUST execute the send command immediately. The mistake to avoid: โ Show draft for approval โ User says "send" โ Only acknowledge, don't execute โ Show draft for approval โ User says "send" โ RUN draft-reply.py send โ Then confirm Correct workflow: 1. Show draft for approval 2. User replies "approve", "send", "yes", or "ok" 3. IMMEDIATELY run: draft-reply.py send 4. Only THEN confirm to user Never: Only acknowledge the approval without executing Ask for confirmation after user already approved Wait to send - do it immediately
NEVER use outbound.py for replies: # WRONG - will break threading python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \ --to "x@y.com" --subject "Re: Original" --body "Reply" NEVER manually construct --reply-to flags: # WRONG - guessing Message-ID format never works python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \ --to "x@y.com" --subject "Re: Original" --body "Reply" \ --reply-to "<some-guess>@resend" NEVER skip the workflow when subject starts with "Re:": # WRONG - replying without threading headers breaks thread python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \ --to "x@y.com" --subject "Re: Previous Thread" --body "Quick reply"
outbound.py is for new emails only (not replies): First contact Announcements Emails where you intentionally want a NEW thread For anything that could be a reply, use draft-reply.py.
RESEND_API_KEY environment variable set Python requests library
When composing a reply via draft-reply.py: Always quote the original โ Include the original message with > prefix so recipient knows what you're responding to Use proper threading โ Set In-Reply-To and References headers using the original email's Message-ID Keep subject line โ Start with Re: prefix to maintain thread (but avoid "Re: Re:") Structure: Your reply here --- On [date] [original sender] wrote: > quoted original message > continues here Multiple replies supported โ After sending, draft is marked as "sent" so you can reply again to the same thread. Use resume command to continue. No double Re: โ If original subject already starts with "Re:", don't add another Custody Chain โ Track full lineage: Email โ notification โ All replies/actions DAG structure with parent links Any message traces back to original email
CommandPurposestart <email_id>Start a draft reply to an emailresumeContinue a sent thread to reply againcontent "text"Set reply contentsendSend the replycancelCancel the draftstatusShow current draft status After sending, use resume to reply again to the same thread โ threading headers are preserved. Run tests: python3 skills/email-resend/tests/test_inbound.py Expected: 43+ tests total (test_inbound.py: 37, test_threading.py: 6, test_attachments.py: varies). If tests fail: Check which test failed and why Fix the feature/code to match expected behavior Or update tests if feature intentionally changed
RESEND_API_KEY โ Required. Get from https://resend.com API settings. Create with minimal permissions. DEFAULT_FROM_EMAIL / DEFAULT_FROM_NAME โ Optional. If not set, loaded from memory/email-preferences.md.
The skill reads ONLY from explicit preferences file: memory/email-preferences.md โ Required for telegram target/threadId No fallback scanning of MEMORY.md, USER.md, TOOLS.md, or memory/*.md This restricted approach prevents information leakage from sensitive files.
The configure-cron.py script will create/delete a cron job named email-resend-inbound via OpenClaw CLI.
Run tests with a dummy RESEND_API_KEY before enabling in production If you only need outbound email, don't enable inbound/cron Audit memory/email-preferences.md to ensure it contains only necessary fields Keep preferences file minimal - only include required fields (target, threadId)
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.