{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.","properties":{"path":{"type":"object","properties":{"account_id":{"description":"Identifier of the account.","type":"string"}},"required":["account_id"],"additionalProperties":false},"body":{"$ref":"#/definitions/email-sending_EmailBuilder"}},"required":["path","body"],"additionalProperties":false,"definitions":{"email-sending_EmailBuilder":{"type":"object","properties":{"attachments":{"description":"File attachments and inline images.","type":"array","items":{"oneOf":[{"$ref":"#/definitions/email-sending_EmailInlineAttachment"},{"$ref":"#/definitions/email-sending_EmailAttachment"}]},"examples":[[{"content":"JVBERi0xLjQK...","disposition":"attachment","filename":"report.pdf","type":"application/pdf"}]]},"bcc":{"description":"Blind carbon copy recipient(s). Optional. A single email string, a named address object, or an array of either.","oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"},{"items":{"oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"}]},"type":"array"}],"examples":[["bcc-recipient@example.com"]]},"cc":{"description":"Carbon copy recipient(s). Optional. A single email string, a named address object, or an array of either.","oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"},{"items":{"oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"}]},"type":"array"}],"examples":[["cc-recipient@example.com"]]},"from":{"description":"Sender email address. Either a plain string or an object with address and name.","oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"}],"examples":["sender@example.com"]},"headers":{"description":"Custom email headers as key-value pairs.","type":"object","additionalProperties":{"type":"string"},"examples":[{"X-Custom-Header":"value"}]},"html":{"description":"HTML body of the email. Provide at least one of text or html (non-empty).","type":"string","examples":["<h1>Hello</h1><p>Please find your report attached.</p>"]},"reply_to":{"description":"Reply-to address. Either a plain string or an object with address and name.","oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"}],"examples":["replies@example.com"]},"subject":{"description":"Email subject line.","type":"string","examples":["Monthly Report"]},"text":{"description":"Plain text body of the email. Provide at least one of text or html (non-empty).","type":"string","examples":["Hello\n\nPlease find your report attached."]},"to":{"description":"Recipient(s). Optional if cc or bcc is provided. A single email string, a named address object, or an array of either.","oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"},{"items":{"oneOf":[{"$ref":"#/definitions/email-sending_EmailAddressString"},{"$ref":"#/definitions/email-sending_EmailAddressObject"}]},"type":"array"}],"examples":[["recipient@example.com"]]}},"additionalProperties":false,"allOf":[{"anyOf":[{"required":["to"],"type":"object"},{"required":["cc"],"type":"object"},{"required":["bcc"],"type":"object"}]},{"anyOf":[{"required":["text"],"type":"object"},{"required":["html"],"type":"object"}]}],"required":["from","subject"],"examples":[{"attachments":[{"content":"JVBERi0xLjQK...","disposition":"attachment","filename":"report.pdf","type":"application/pdf"}],"from":"sender@example.com","html":"<h1>Hello</h1><p>Please find your report attached.</p>","subject":"Monthly Report","text":"Hello\n\nPlease find your report attached.","to":["recipient@example.com"]}]},"email-sending_EmailInlineAttachment":{"type":"object","properties":{"content":{"description":"Base64-encoded content of the attachment.","type":"string","examples":["iVBORw0KGgoAAAANSUhEUgAA..."]},"content_id":{"description":"Content ID used to reference this attachment in HTML via cid: URI (e.g., <img src=\"cid:logo\">).","type":"string","examples":["logo"]},"disposition":{"description":"Use 'inline' to embed the attachment in the email body.","type":"string","enum":["inline"]},"filename":{"description":"Filename for the attachment.","type":"string","examples":["logo.png"]},"type":{"description":"MIME type of the attachment (e.g., 'image/png', 'text/plain').","type":"string","examples":["image/png"]}},"required":["disposition","content_id","filename","type","content"],"examples":[{"content":"iVBORw0KGgoAAAANSUhEUgAA...","content_id":"logo","disposition":"inline","filename":"logo.png","type":"image/png"}]},"email-sending_EmailAttachment":{"type":"object","properties":{"content":{"description":"Base64-encoded content of the attachment.","type":"string","examples":["JVBERi0xLjQK..."]},"disposition":{"description":"Use 'attachment' for a standard file attachment.","type":"string","enum":["attachment"]},"filename":{"description":"Filename for the attachment.","type":"string","examples":["report.pdf"]},"type":{"description":"MIME type of the attachment (e.g., 'application/pdf', 'text/plain').","type":"string","examples":["application/pdf"]}},"required":["disposition","filename","type","content"],"examples":[{"content":"JVBERi0xLjQK...","disposition":"attachment","filename":"report.pdf","type":"application/pdf"}]},"email-sending_EmailAddressString":{"description":"An email address as a plain string.","type":"string","pattern":"^[\\x20-\\x7E]+$","examples":["user@example.com"]},"email-sending_EmailAddressObject":{"type":"object","properties":{"address":{"description":"Email address (e.g., 'user@example.com').","type":"string","pattern":"^[\\x20-\\x7E]+$","examples":["user@example.com"]},"name":{"description":"Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.","type":["string","null"],"examples":["John Doe"]}},"required":["address"],"examples":[{"address":"user@example.com","name":"John Doe"}]}}},"name":"Send an email","id":"cloudflare.email-sending-account-send-builder","example":{"path":{"account_id":"example"},"body":{"attachments":[{"content":"JVBERi0xLjQK...","disposition":"attachment","filename":"report.pdf","type":"application/pdf"}],"from":"sender@example.com","html":"<h1>Hello</h1><p>Please find your report attached.</p>","subject":"Monthly Report","text":"Hello\n\nPlease find your report attached.","to":["recipient@example.com"]}},"maxRequests":1,"summary":false}}