AgentSkillsCN

resend-email

使用 Resend API 实现程序化邮件发送。支持自定义收件人,并在无指定收件人时自动回退至 ltononro@gmail.com。触发条件:用户请求通过 Resend 发送邮件、执行程序化邮件发送,或使用 Resend API。该技能会调用一个 Python 脚本,传入主题、正文以及可选收件人参数。

SKILL.md
--- frontmatter
description: Send emails programmatically using the Resend API. Supports custom recipients
  with fallback to ltononro@gmail.com. TRIGGERS - User asks to send email via Resend,
  send programmatic email, or use Resend API. Executes a Python script with subject,
  body, and optional recipient arguments.
name: resend-email

Resend Email Skill

Send emails programmatically using the Resend API via a Python script.

Default Recipient: ltononro@gmail.com (if --to is not provided) From: CodeWorks Agent <lucas.tonon@dbx0.lol>

Prerequisites

  1. Resend API Key - Must be set in .env file at project root:

    code
    RESEND_API_KEY=re_xxxxxxxxxx
    
  2. Python dependencies - Install resend and python-dotenv:

    bash
    pip install resend python-dotenv
    

Usage

bash
python scripts/send-email.py --subject="Email Subject" --body="Email body content"

With a custom recipient:

bash
python scripts/send-email.py --to="user@example.com" --subject="Email Subject" --body="Email body content"

Or with HTML content:

bash
python scripts/send-email.py --subject="Email Subject" --html="<h1>HTML content</h1>"

Arguments

ArgumentRequiredDescription
--toNoRecipient email address (default: ltononro@gmail.com)
--subjectYesEmail subject line
--bodyNo*Plain text email body (converted to HTML)
--htmlNo*HTML email body for rich formatting

*Must provide either --body or --html

Exit Codes

CodeMeaning
0Email sent successfully
1Error (missing API key, API error)

Examples

bash
# Simple text email (to default recipient)
python scripts/send-email.py --subject="Hello" --body="This is a test email."

# Email to custom recipient
python scripts/send-email.py --to="user@example.com" --subject="Hello" --body="This is a test email."

# HTML newsletter
python scripts/send-email.py --subject="Weekly Update" --html="<h1>This Week</h1><ul><li>Item 1</li><li>Item 2</li></ul>"

# Multi-line body
python scripts/send-email.py --subject="Report" --body="Line 1
Line 2
Line 3"

Notes

  • Default recipient is ltononro@gmail.com (used when --to is not provided)
  • From address is CodeWorks Agent <lucas.tonon@dbx0.lol>
  • Plain text body is automatically converted to HTML with line breaks
  • API response includes the email ID for tracking

Troubleshooting

IssueSolution
RESEND_API_KEY not foundCreate .env file with your API key
Invalid API keyVerify key in Resend dashboard
Must provide either --body or --htmlAdd content argument