Resend Email Skill
Send emails programmatically using the Resend API via a Python script with a professional HTML template and file attachment support.
Default Recipient: ltononro@gmail.com (if --to is not provided)
From: CodeWorks Agent <lucas.tonon@dbx0.lol>
Features
- •Professional HTML Template - All emails are wrapped in a clean, responsive template with:
- •Gradient header with CodeWorks Agent branding
- •Clean white content area with proper typography
- •Footer with copyright and attribution
- •Mobile-responsive design
- •Outlook/MS Office compatibility
- •Template can be disabled - Use
--no-templateto send raw content - •File Attachments - Attach any files (PDFs, images, documents, etc.) using
--attachments
Prerequisites
- •
Resend API Key - The API key is stored in
.claude/skills/resend-email/.env:codeRESEND_API_KEY=re_JWHGALZV_LsD4NMGfdjQVNJrZQb8b2PnU
This file is bundled with the skill and will be copied when the skill is attached to an agent.
- •
Python dependencies - Install resend and python-dotenv:
bashpip install resend python-dotenv
Usage
Run from the agent's repository root:
python .claude/skills/resend-email/scripts/send-email.py --subject="Email Subject" --body="Email body content"
With a custom recipient:
python .claude/skills/resend-email/scripts/send-email.py --to="user@example.com" --subject="Email Subject" --body="Email body content"
With HTML content:
python .claude/skills/resend-email/scripts/send-email.py --subject="Email Subject" --html="<h1>HTML content</h1>"
Without the template (raw content):
python .claude/skills/resend-email/scripts/send-email.py --subject="Email Subject" --body="Plain content" --no-template
With file attachments:
python .claude/skills/resend-email/scripts/send-email.py --subject="Report" --body="Please find attached." --attachments="/path/to/report.pdf"
With multiple attachments:
python .claude/skills/resend-email/scripts/send-email.py --subject="Files" --body="Here are the files." --attachments="/path/to/file1.pdf,/path/to/image.png,/path/to/doc.docx"
Arguments
| Argument | Required | Description |
|---|---|---|
--to | No | Recipient email address (default: ltononro@gmail.com) |
--subject | Yes | Email subject line |
--body | No* | Plain text email body (converted to HTML) |
--html | No* | HTML email body for rich formatting |
--no-template | No | Skip the HTML template wrapper and send raw content |
--attachments | No | Comma-separated list of file paths to attach |
*Must provide either --body or --html
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Email sent successfully |
| 1 | Error (missing API key, API error) |
Examples
# Simple text email with template (to default recipient) python .claude/skills/resend-email/scripts/send-email.py --subject="Hello" --body="This is a test email." # Email to custom recipient python .claude/skills/resend-email/scripts/send-email.py --to="user@example.com" --subject="Hello" --body="This is a test email." # HTML newsletter with template python .claude/skills/resend-email/scripts/send-email.py --subject="Weekly Update" --html="<h1>This Week</h1><ul><li>Item 1</li><li>Item 2</li></ul>" # Raw HTML without template python .claude/skills/resend-email/scripts/send-email.py --subject="Custom Email" --html="<html><body>Custom HTML</body></html>" --no-template # Multi-line body python .claude/skills/resend-email/scripts/send-email.py --subject="Report" --body="Line 1 Line 2 Line 3" # Email with single attachment python .claude/skills/resend-email/scripts/send-email.py --subject="Invoice" --body="Please find your invoice attached." --attachments="/tmp/invoice.pdf" # Email with multiple attachments python .claude/skills/resend-email/scripts/send-email.py --subject="Project Files" --body="Here are the requested files." --attachments="/tmp/report.pdf,/tmp/chart.png,/tmp/data.xlsx" # Email with attachment to custom recipient python .claude/skills/resend-email/scripts/send-email.py --to="client@example.com" --subject="Contract" --body="Please review the attached contract." --attachments="/tmp/contract.pdf"
Template Styling
The HTML template supports the following content elements with built-in styling:
- •Headings (h1, h2, h3, h4) - Dark text with proper sizing
- •Paragraphs - Gray text with comfortable line height
- •Links - Indigo color (#6366f1) with hover underline
- •Lists (ul, ol) - Properly spaced items
- •Code blocks - Light background with monospace font
- •Blockquotes - Indigo left border with light background
Notes
- •Default recipient is
ltononro@gmail.com(used when--tois not provided) - •From address is
CodeWorks Agent <lucas.tonon@dbx0.lol> - •Plain text body is automatically converted to HTML with line breaks
- •By default, all emails use the professional HTML template
- •Use
--no-templateto send raw content without the wrapper - •API response includes the email ID for tracking
- •The .env file with the API key is located at
.claude/skills/resend-email/.env - •Attachments are read from disk and base64 encoded before sending
- •Multiple attachments can be specified as a comma-separated list
- •Invalid attachment paths are skipped with a warning (email still sends)
Troubleshooting
| Issue | Solution |
|---|---|
RESEND_API_KEY not found | Ensure .claude/skills/resend-email/.env file exists with API key |
Invalid API key | Verify key in Resend dashboard |
Must provide either --body or --html | Add content argument |
Attachment file not found | Verify the file path exists and is accessible |
No valid attachments found | Check that all provided file paths are correct |