首页/自动化与工作流/recoup-platform-email-helper
R

recoup-platform-email-helper

by @recoupablev
4.4(120)

此技能是一个 Node.js 脚本,用于通过邮件 API 可靠地发送邮件。它自动处理请求体序列化,避免手动 curl 时的转义错误,确保邮件正确发送。适用于在任务中发送报告、通知或摘要给收件人,必须使用此脚本而非手动构建请求。

emailapinodejsautomationnotificationGitHub
安装方式
npx skills add https://github.com/recoupable/skills --skill recoup-platform-email-helper
compare_arrows

Before / After 效果对比

1 组
使用前

开发者手动构建 curl 发送邮件时,常因引号转义错误导致 API 返回成功但实际发送空邮件,排查问题耗时且不可靠。

使用后

此技能自动序列化请求体并验证,确保邮件正确发送,失败时明确报错,无需排查空邮件问题。

SKILL.md

Sending email from a task

Send email by running the bundled Node script — do not assemble JSON in the shell.

Why this exists

Hand-rolling the send (curl -sS … -d "{… \"html\": $(echo "$HTML" | jq -R -s '.') …}") is fragile: depending on quoting/escaping it produces a malformed body, and the API used to silently deliver an empty footer-only email titled "Message from Recoup" with success:true. The model gets this wrong stochastically. This script removes shell serialization entirely.

How to send

  1. Write the email body to a file (recommended for HTML — avoids all escaping issues):

    cat > /tmp/report.html <<'HTML'
    <h1>Daily Report</h1>
    <p>…your real content…</p>
    HTML
    
  2. Send it:

    node "$SKILL_DIR/scripts/send-email.mjs" \
      --subject "Daily Report — $(date '+%B %d, %Y')" \
      --html-file /tmp/report.html \
      --to owner@example.com
    

$SKILL_DIR is this skill's install directory (~/.agents/skills/recoup-platform-email-helper); use the absolute path to scripts/send-email.mjs.

Flags

FlagMeaning
--subject <s>Subject line (optional — the API derives one from the body if omitted).
--html-file <path> / --html <s>HTML body. Prefer --html-file.
--text-file <path> / --text <s>Plain-text body.
--to <email>Recipient (repeatable). Omit to default to the account's own email ("email me this").
--cc <email>CC (repeatable).
--chat-id <id>Room id for the footer "continue the conversation" link.
--dry-runSerialize + validate and print the payload; do not send. Use to preview.

Rules

  • Exactly one body is required. The script refuses to send (exit code 2) if there is no non-empty --html/--text. Never try to send an empty email.
  • Check the exit code. Non-zero means it did not send — read stderr and fix it; do not report success. The script prints the Resend message id on a real send.
  • The script reads RECOUP_API_KEY / RECOUP_ACCESS_TOKEN and RECOUP_API_BASE from the environment — these are already set in the sandbox. Never print or hard-code them.
  • Node only (the sandbox runtime is node22; python3 is not guaranteed). Zero dependencies.

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量4.8K
评分4.4 / 5.0
版本
更新日期2026年10月20日
对比案例1 组

用户评分

4.4(120)
5
37%
4
43%
3
13%
2
5%
1
2%

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年7月19日
最后更新2026年10月20日
🎁 Agent 知识卡片
调研问卷