Functions
send-email
fn (request: SendEmailRequest): SendEmailResponse | AwsError
Send an email via AWS SES v2 API using a full SendEmailRequest.
For simple emails, prefer the send-simple-email convenience function.
Example
destination Destination({to_addresses: ["user@example.com"], cc_addresses: null, bcc_addresses: null})
body Body({text: "Hello!", html: "<h1>Hello!</h1>"})
message Message({subject: "Test Subject", body: body})
content EmailContent({simple: message, raw: null, template: null})
request SendEmailRequest({
from_email_address: "sender@example.com",
destination: destination,
content: content,
reply_to_addresses: null,
configuration_set_name: null
})
result ::aws::ses::email/send-email(request)
result.message_id // => "010001234567890-abcdef..."
send-raw-email
fn (raw_message: Str): SendEmailResponse | AwsError
Send a raw MIME email via AWS SES.
Use this for complex email formats like multipart messages with attachments.
Example
raw-message "From: sender@example.com\nTo: user@example.com\nSubject: Test\n\nBody"
result ::aws::ses::email/send-raw-email(raw-message)
send-simple-email
fn (from: Str, to: Vec, subject: Str, body_text: Str, body_html: Str): SendEmailResponse | AwsError
fn (from: Str, to: Vec, subject: Str, body_text: Str): SendEmailResponse | AwsError
Send a simple email with just from, to, subject, and body.
Example
result ::aws::ses::email/send-simple-email(
"sender@example.com",
["user@example.com"],
"Welcome!",
"Hello from Hot!",
"<h1>Hello from Hot!</h1>"
)
result.message_id // => "010001234567890-abcdef..."
// Text-only email (no HTML)
result ::aws::ses::email/send-simple-email(
"sender@example.com",
["user@example.com"],
"Alert",
"Something happened"
)
send-templated-email
fn (from: Str, to: Vec, template_name: Str, template_data: Map): SendEmailResponse | AwsError
Send an email using an SES template.
Example
result ::aws::ses::email/send-templated-email(
"sender@example.com",
["user@example.com"],
"WelcomeTemplate",
{name: "Alice", company: "Acme"}
)
result.message_id // => "010001234567890-abcdef..."
Types
Body
Body type {
text: Str?,
html: Str?
}
Destination
Destination type {
to_addresses: Vec,
cc_addresses: Vec?,
bcc_addresses: Vec?
}
EmailContent
EmailContent type {
simple: Message?,
raw: Str?,
template: TemplateContent?
}
Message
Message type {
subject: Str,
body: Body
}
SendEmailRequest
SendEmailRequest type {
from_email_address: Str,
destination: Destination,
content: EmailContent,
reply_to_addresses: Vec?,
configuration_set_name: Str?
}
SendEmailResponse
SendEmailResponse type {
message_id: Str?
}
TemplateContent
TemplateContent type {
template_name: Str,
template_data: Map
}