send-email
Send an email via Resend API from ${IRIS_EMAIL_FROM:-iris@example.com}. Use when human escalation is needed or to deliver results outside Slack/Telegram.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Send an email via Resend API from ${IRIS_EMAIL_FROM:-iris@example.com}. Use when human escalation is needed or to deliver results outside Slack/Telegram.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create a new sub-agent — no Terraform, no Docker by default. Starts as a systemd service, patched into the bridge immediately so @agent works right away.
Commit and push repo changes to GitHub using the standard Iris workflow.
Search the web using Perplexity AI API. Returns sourced, up-to-date information.
Transcribe an audio file (m4a, mp3, wav, ogg, webm) to text using OpenAI Whisper API. Use when a user shares a voice note or audio attachment.
Add, remove, and test MCP (Model Context Protocol) servers by editing meta/mcp.json. Tools from connected servers appear automatically as mcp__<server>__<tool>.
Expose a local port as a public HTTPS subdomain under IRIS_BASE_DOMAIN. Writes nginx config, obtains SSL cert via certbot, reloads nginx.
| name | send-email |
| description | Send an email via Resend API from ${IRIS_EMAIL_FROM:-iris@example.com}. Use when human escalation is needed or to deliver results outside Slack/Telegram. |
| secrets | ["RESEND-API-KEY"] |
Send an email from ${IRIS_EMAIL_FROM:-iris@example.com} using the Resend API.
Available to Iris and all sub-agents. Use when you need to reach a human outside the chat interface
(escalation, reports, alerts) or when asked to send an email.
send-email --to <address> --subject "<subject>" --body "<plain text body>"
Or pipe the body:
echo "body text" | send-email --to <address> --subject "<subject>"
--to Recipient email address (required)--subject Email subject line (required)--body Email body as plain text. If omitted, reads from stdin.--html Optional HTML body (if set, overrides plain-text rendering)--from Override sender (default: Iris <${IRIS_EMAIL_FROM:-iris@example.com}>)#!/usr/bin/env bash
set -euo pipefail
TO=""
SUBJECT=""
BODY=""
HTML=""
FROM="Iris <${IRIS_EMAIL_FROM:-iris@example.com}>"
while [[ $# -gt 0 ]]; do
case "$1" in
--to) TO="$2"; shift 2 ;;
--subject) SUBJECT="$2"; shift 2 ;;
--body) BODY="$2"; shift 2 ;;
--html) HTML="$2"; shift 2 ;;
--from) FROM="$2"; shift 2 ;;
*) echo "Unknown option: $1" >&2; exit 1 ;;
esac
done
[[ -z "$TO" ]] && { echo "send-email: --to is required" >&2; exit 1; }
[[ -z "$SUBJECT" ]] && { echo "send-email: --subject is required" >&2; exit 1; }
# Read body from stdin if not provided via --body
if [[ -z "$BODY" ]]; then
BODY=$(cat)
fi
RESEND_API_KEY=$(get-secret RESEND-API-KEY)
[[ -z "$RESEND_API_KEY" ]] && { echo "send-email: RESEND-API-KEY not found in Key Vault" >&2; exit 1; }
# Build JSON payload
if [[ -n "$HTML" ]]; then
PAYLOAD=$(jq -n \
--arg from "$FROM" \
--arg to "$TO" \
--arg subject "$SUBJECT" \
--arg html "$HTML" \
--arg text "$BODY" \
'{"from":$from,"to":[$to],"subject":$subject,"html":$html,"text":$text}')
else
PAYLOAD=$(jq -n \
--arg from "$FROM" \
--arg to "$TO" \
--arg subject "$SUBJECT" \
--arg text "$BODY" \
'{"from":$from,"to":[$to],"subject":$subject,"text":$text}')
fi
RESPONSE=$(curl -s -w "\n%{http_code}" \
-X POST "https://api.resend.com/emails" \
-H "Authorization: Bearer $RESEND_API_KEY" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY_RESP=$(echo "$RESPONSE" | head -1)
if [[ "$HTTP_CODE" -ge 200 && "$HTTP_CODE" -lt 300 ]]; then
EMAIL_ID=$(echo "$BODY_RESP" | jq -r '.id // "unknown"')
echo "Email sent successfully (id: $EMAIL_ID)"
else
echo "send-email: API error $HTTP_CODE: $BODY_RESP" >&2
exit 1
fi
jq and curl (available on all Iris hosts)get-secret RESEND-API-KEY (resolved from env var RESEND_API_KEY, Key Vault, or your secret broker)IRIS_EMAIL_FROM must be verified in Resend (add the DNS records Resend shows for your domain)# Escalate a failure to the human operator
send-email \
--to operator@example.com \
--subject "Iris: sub-agent weather is unresponsive" \
--body "Weather agent failed to respond after 3 retries. Manual intervention required."
# Send a report
generate-report | send-email --to team@example.com --subject "Daily digest"