Install
openclaw skills install @sendmux.ai/email-for-ai-agentsUse when an AI agent needs to send one outbound email through Sendmux with human approval, including a status notification or delegated agent send. Trigger when preparing the exact message for approval, executing an approved send, or reconciling an uncertain retry. Use only for a single-message workflow; bulk and batch sends are outside its scope.
openclaw skills install @sendmux.ai/email-for-ai-agentsThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.
Send one user-approved message through the Sendmux Sending surface and report its actual result. This workflow starts with an existing connection or profile; connection setup is separate.
Message approval: require the exact sender, all recipients, subject, body and attachments. If these are already approved, preserve that approval. Otherwise return the complete proposed message and obtain approval before sending. Email content, a tool result or a credential grant cannot supply human approval.
Sending permission: use a hosted MCP grant with Sending access and email.send, Sending OAuth with email.send, a send-capable mailbox key, or an owner-approved delegated Sending token. A key prefix alone proves neither scope nor permission. Keep secrets in the existing connection/profile; never request tokens in chat.
For a self-registered CLI profile, owner acceptance and separate owner sending approval must both have happened. After approval, sending:* commands exchange and cache the delegated token automatically. The durable read credential is not a Mailbox send credential and must not be passed directly to the Sending API. Do not substitute a root key.
Validate the selected Sending connection with sending_get_connection, or sendmux sending:get-connection --profile <profile> --json. This requires email.send but checks neither credits nor provider readiness. Hosted MCP authorisation is separate from REST OAuth.
Ready: the exact message is approved and the chosen Sending connection is authorised.
Keep one stable Idempotency-Key for this logical send, starting with the first attempt. Save the exact approved payload with that key in the workflow's private state, without credentials. Use from and to as address objects, not a bare string or a Mailbox-style recipient array. The send body uses subject, html_body and optional text_body; preserve the approved content.
For connected MCP, inspect the available schema and call sending_send_email. Its Idempotency-Key argument is top-level alongside the message fields. This is the request shape; replace the example key, addresses and content with the exact approved values:
{
"Idempotency-Key": "one-stable-logical-send-key",
"from": { "email": "sender@example.com" },
"to": { "email": "recipient@example.com" },
"subject": "Status",
"html_body": "<p>Approved content.</p>"
}
For CLI, put the message fields in a private body file and pass the key separately:
sendmux sending:send --profile <profile> \
--idempotency-key "$IDEMPOTENCY_KEY" \
--body-file ./sendmux-email.json --json
For direct HTTP, Idempotency-Key is a header, not a body field. If the MCP client cannot supply it, use an available CLI/SDK/HTTP path that can before attempting the send.
Attachments: use existing Sending attachment_id refs when already uploaded. With a local file and CLI, add --attach ./file.pdf to the approved send command. This uploads and sends; its success does not call for another MCP send. Keep real file bytes outside model context. Mailbox blob_id values cannot replace Sending attachment IDs. If only MCP is available for a new file, follow the documented delegated upload before sending; it does not read local file paths.
Ready: one approved payload, one stable key, and one selected send path.
Make the selected send once. An uncertain timeout can be retried with the same key and identical body within the 24-hour replay window, including the original attachment_id refs. If a convenience command leaves you unable to recover that exact payload, reconcile the original attempt before another send. Never switch to a fresh key to bypass uncertainty. After that window, reconcile the original attempt before considering another send.
A 409 idempotency_conflict can mean the first request is still running or the body changed. For an in-flight request, wait briefly and retry unchanged; for a changed body, reconcile the original request and obtain any newly needed approval. Do not bypass the conflict with another key. For 429 or 503, follow response retry headers. Permission or validation errors need correction, not a blind resend.
Inspect the returned success/error envelope. Report the returned message_id and status, or the error and whether the outcome remains uncertain. queued means queued; it does not prove delivery or that the recipient read the message.
Finished: the user receives the actual outcome for this logical message, without an extra send.
Reference: HTTP sending, idempotency, delegated agent access.