← 返回 Skills 市场
ivelin

Email Resend

作者 Ivelin Ivanov · GitHub ↗ · v1.0.14
cross-platform ⚠ suspicious
1234
总下载
0
收藏
3
当前安装
15
版本数
在 OpenClaw 中安装
/install email-resend
功能描述
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...
使用说明 (SKILL.md)

License

Apache License 2.0 — See LICENSE file for full text.

Email via Resend

Send and receive emails using the Resend API.

Configuration

No config file needed. The skill auto-discovers settings from:

  1. Environment variables — RESEND_API_KEY (required), DEFAULT_FROM_EMAIL/NAME (optional)
  2. Preferences filememory/email-preferences.md (from_email, from_name, telegram target)
  3. OpenClaw context — channel, chat_id, thread_id (for cron delivery)

Required Environment Variables

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

Preferences File

The skill reads sender info from memory/email-preferences.md:

---
from_email: [email protected]
from_name: Your Name
telegram:
  target: "CHAT_ID"
  threadId: "THREAD_ID"
---

Scripts check env vars first, then fall back to preferences file.

First-Time Setup

When the skill is first invoked, the sub-agent should:

  1. Check context — OpenClaw context already has:

    • context.user.email (from USER.md)
    • context.channel (from current session)
    • context.chat_id
    • context.thread_id (for topics)
  2. Check memory — Use memory_get tool:

    • Try: memory_get path="memory/email-preferences.md"
    • If not found, ask user to create memory/email-preferences.md (NO fallback scanning)
  3. If missing, ask user — Via chat message (IMPORTANT for cron jobs):

    • "Which email should I send from?" (from_email)
    • "What's your display name for sent emails?" (from_name)
    • "Which channel/topic should I notify you on?" (telegram target + threadId)

    Then create memory/email-preferences.md with their answers using the format above.

  4. Commit to memory — Write preferences to persist across sessions:

    write path="memory/email-preferences.md" content="---
    from_email: $EMAIL
    from_name: $NAME
    telegram:
      target: \"$CHAT_ID\"
      threadId: \"$THREAD_ID\"
    ---
    
    # Email Notification Preferences
    Saved auto-configured
    "
    

    This ensures memory_get finds it in future sessions. Use MD format with YAML frontmatter.

Format (MD with YAML frontmatter):

---
from_email: [email protected]
from_name: Your Name
telegram:
  target: \"123456789\"
  threadId: \"334\"
---

# Email Notification Preferences
- **Updated:** 2026-01-01
- **Purpose:** Default notification channel for email alerts

Important: Store in memory/email-preferences.md (NOT MEMORY.md) - isolated cron jobs can read this file via memory_get but NOT MEMORY.md.

Context Fields (Available in Sub-Agent)

Field Source Example
user.email USER.md [email protected]
user.name USER.md Your Name
channel OpenClaw from context
chat_id OpenClaw 123456789
thread_id OpenClaw 334

The skill uses these directly from OpenClaw context — no parsing needed.

Usage

Inbound (Receive)

Cron Setup

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:

  1. Reads memory/email-preferences.md for your telegram target/threadId
  2. Deletes any existing email-resend-inbound cron
  3. 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)

Manual Check

python3 ~/.openclaw/workspace/skills/email-resend/scripts/inbound.py

Notification Format

Each new email triggers a notification with:

  • From, Subject, Date
  • Body preview (~2000 chars)
  • Attachment list (if any)
  • Importance: 🔥 HIGH / 📅 MEETING / 📬 NORMAL

Acknowledge Flow (CRITICAL)

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="\x3Cfrom-context>", replyTo="\x3Cmsg_id>", ...)

Scripts

Script Purpose
inbound.py Check emails, send notifications
draft-reply.py Draft reply workflow with quoting & threading
outbound.py Send emails directly
download_attachment.py Download attachments from inbound emails

Downloading Attachments

To download attachments from an inbound email:

# List attachments (shows IDs)
python3 scripts/download_attachment.py \x3Cemail_id> --list

# Download all to directory
python3 scripts/download_attachment.py \x3Cemail_id> --output-dir ./attachments

# Download specific attachment
python3 scripts/download_attachment.py \x3Cemail_id> --attachment-id \x3Cattachment_id>

Note: The API path is /emails/receiving/{email_id}/attachments (not the standard /emails/ path).

State Files

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

Outbound (Send)

python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \
  --to "[email protected]" \
  --subject "Hello" \
  --body "Message text"

# With attachments
python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \
  --to "[email protected]" \
  --subject "Here's the file" \
  --body "See attachment" \
  --attachment ./file.pdf \
  --attachment ./image.png

⚠️ CRITICAL: Email Threading Rule (2026-02-22)

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.

Why This Matters

  • 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

✅ Correct Workflow (ALWAYS USE THIS)

# Step 1: Start draft (fetches Message-ID automatically)
python3 ~/.openclaw/workspace/skills/email-resend/scripts/draft-reply.py start \x3Cemail_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

⚠️ CRITICAL: Approval Execution Rule (2026-02-22)

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 Do These Things

NEVER use outbound.py for replies:

# WRONG - will break threading
python3 ~/.openclaw/workspace/skills/email-resend/scripts/outbound.py \
  --to "[email protected]" --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 "[email protected]" --subject "Re: Original" --body "Reply" \
  --reply-to "\x3Csome-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 "[email protected]" --subject "Re: Previous Thread" --body "Quick reply"

outbound.py Only For New Emails

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.

Requirements

  • RESEND_API_KEY environment variable set
  • Python requests library

Draft Reply Best Practices

When composing a reply via draft-reply.py:

  1. Always quote the original — Include the original message with > prefix so recipient knows what you're responding to

  2. Use proper threading — Set In-Reply-To and References headers using the original email's Message-ID

  3. Keep subject line — Start with Re: prefix to maintain thread (but avoid "Re: Re:")

  4. Structure:

    Your reply here
    
    ---
    
    On [date] [original sender] wrote:
    > quoted original message
    > continues here
    
  5. Multiple replies supported — After sending, draft is marked as "sent" so you can reply again to the same thread. Use resume command to continue.

  6. No double Re: — If original subject already starts with "Re:", don't add another

  7. Custody Chain — Track full lineage:

    • Email → notification → All replies/actions
    • DAG structure with parent links
    • Any message traces back to original email

Draft Reply Commands

Command Purpose
start \x3Cemail_id> Start a draft reply to an email
resume Continue a sent thread to reply again
content "text" Set reply content
send Send the reply
cancel Cancel the draft
status Show 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:

  1. Check which test failed and why
  2. Fix the feature/code to match expected behavior
  3. Or update tests if feature intentionally changed

⚠️ Privacy & Security Considerations

Required Credentials

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

Memory File Access

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.

Cron Job

The configure-cron.py script will create/delete a cron job named email-resend-inbound via OpenClaw CLI.

Recommendations

  • 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)
安全使用建议
This skill appears to do what it says: it needs your Resend API key so it can read inbound emails and send messages via api.resend.com. Before installing: (1) be prepared to provide RESEND_API_KEY — anyone with that key can send and read mail for that account, so prefer a scoped/rotated key if possible; (2) the skill will create and modify files under ~/.openclaw/workspace/memory/ (preferences, custody chain, state files) and may add an openclaw cron job — verify the cron target (chat_id/topic) before enabling; (3) attachments downloaded by the skill are written to disk — treat them like any downloaded files; (4) there are some minor implementation issues (truncated code in draft-reply.py) — consider testing in an isolated environment before trusting it for production; (5) if you do not want the skill to post notifications to a global/static target, avoid running the hardcoded cron example and instead use the dynamic preferences flow. If you want more assurance, review/run the included tests and inspect the created memory files after a dry-run.
功能分析
Type: OpenClaw Skill Name: email-resend Version: 1.0.14 The skill is classified as suspicious due to several powerful capabilities that, while aligned with its stated purpose, present significant vulnerability risks. Specifically, `scripts/configure-cron.py` can add and delete `openclaw cron` jobs, allowing modification of scheduled tasks. `scripts/download_attachment.py` can write arbitrary files to the filesystem (attachments), and `scripts/outbound.py` can read arbitrary local files (attachments) for exfiltration via email. While the `SKILL.md` and `cron-prompts/email-inbound.md` contain strong, explicit instructions to the agent to prevent sensitive file scanning and unauthorized actions, these underlying code capabilities could be exploited if the agent is compromised or instructed maliciously, even if the current prompts aim to prevent this.
能力评估
Purpose & Capability
Name/description (send/receive via Resend) align with required env var (RESEND_API_KEY), required binaries (python3, openclaw), and included scripts (inbound/outbound/draft-reply/download_attachment). The declared Python deps (requests, pyyaml) match the code.
Instruction Scope
SKILL.md and cron prompts direct the agent to read/write a dedicated preferences file (memory/email-preferences.md) and to use memory_get/memory_write patterns; scripts read/write workspace memory files (~/.openclaw/workspace/memory/*) and call the openclaw CLI to manage cron jobs. These actions are appropriate for an email notification/cron skill, but note small inconsistencies: SKILL.md warns not to scan other memory files, while comments in inbound.py mention the agent will use memory_search + message tool for delivery (this is contextual, not obviously malicious). Also some source appears truncated/buggy in places (draft-reply.py partially truncated) — that is an implementation quality issue, not a scope creep concern.
Install Mechanism
Instruction-only skill with included Python scripts; no external downloads, no package installs from untrusted URLs, and no extract/install steps. Low install risk.
Credentials
Only required environment variable is RESEND_API_KEY (appropriate for Resend API access). Optional env vars DEFAULT_FROM_EMAIL/NAME and OpenClaw runtime vars (CLAW_CHAT_ID, CLAW_THREAD_ID, etc.) are reasonable and used for preferences and cron configuration. No unrelated cloud credentials or broad secrets are requested.
Persistence & Privilege
Skill is not always-enabled and uses standard files under the user workspace (~/.openclaw/workspace/memory/...). It creates/updates its own memory and state files (custody chain, pending/acknowledged state) but does not modify other skills or system-wide settings beyond adding a cron via the openclaw CLI (expected for a cron-based notifier). Autonomous model invocation is default but not combined with other red flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install email-resend
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /email-resend 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.14
email-resend 1.0.14 - Updated version to 1.0.14. - Documentation updates in SKILL.md for clarity and maintenance; no code or feature changes.
v1.0.13
- Improved setup instructions and clarified behavior when preferences are missing—sub-agent now asks user to create preferences file if not found, rather than scanning memory. - Updated SKILL.md for simpler and more explicit configuration guidance. - No feature or interface changes to core email sending or receiving.
v1.0.12
Fixed: Declared all dependencies in metadata (openclaw CLI, requests, pyyaml). Added manual-only mode option to avoid memory scanning.
v1.0.11
Fixed metadata format for ClawHub registry
v1.0.10
Fixed: Added privacy/security section, explicit version, documented memory file access
v1.0.9
Security fixes and improvements: fixed security issues (removed exec(open) pattern, removed $(date) injection), consolidated from_email/from_name into preferences file, added pytest test runner.
v1.0.8
Removed hardcoded Telegram ID from cron prompt, use dynamic routing
v1.0.7
Fixed: all required env vars declared, skipped demo test expecting ClawCon files
v1.0.6
Made license section prominent with dedicated heading
v1.0.5
Added license info to description and added README.md for prominent license display
v1.0.4
Fixed metadata: added requires.env field for RESEND_API_KEY
v1.0.3
Added license field to YAML frontmatter
v1.0.2
Fixed SKILL.md contradictions, added license to description
v1.0.1
Added Apache 2.0 license
v1.0.0
Channel-agnostic, memory_search integration, cleaned for publishing
元数据
Slug email-resend
版本 1.0.14
许可证
累计安装 3
当前安装数 3
历史版本数 15
常见问题

Email Resend 是什么?

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1234 次。

如何安装 Email Resend?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install email-resend」即可一键安装,无需额外配置。

Email Resend 是免费的吗?

是的,Email Resend 完全免费(开源免费),可自由下载、安装和使用。

Email Resend 支持哪些平台?

Email Resend 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Email Resend?

由 Ivelin Ivanov(@ivelin)开发并维护,当前版本 v1.0.14。

💬 留言讨论