aws.ses
Module aws.ses
API
Declarations
Definitions
ballerinax/aws.ses Ballerina library
Overview
Amazon Simple Email Service (Amazon SES) is a cost-effective, flexible, and scalable email service that lets applications send mail from within any application — transactional messages, marketing campaigns, and bulk communications alike. Its flexible IP deployment and email authentication options help drive deliverability and protect sender reputation, while sending analytics measure the impact of each message.
The Amazon SES connector offers APIs to connect and interact with the Amazon SES API v2 endpoints.
Key features
- Send email three ways: a simple message assembled by Amazon SES, a raw MIME message carrying its own headers and attachments, or a templated message whose placeholders Amazon SES fills in
- Bulk sending, with one templated message per recipient and a per-recipient result
- Manage email identities, including DKIM setup (Easy DKIM and BYODKIM), custom MAIL FROM domains, and sending authorization policies
- Manage contact lists, contacts, and topics, with subscription filtering and unsubscribe-link support through list management options
- Manage email templates and custom verification email templates
- Auto-paginating streams over every list operation, so results beyond the first page are reachable
- Flexible credential configuration: static keys, AWS credentials file profiles, STS assume-role, web identity (OIDC), IAM Identity Center (SSO), an external credential process, or the default AWS credential provider chain
- Automatic refresh of expiring temporary credentials
- FIPS, dualstack, and custom endpoint support
Setup guide
Verify an email identity
Amazon SES only sends from an address or domain you have proved you own. In the Amazon SES console, open Identities > Create identity and verify either:
| Identity type | What to verify | When to use it |
|---|---|---|
| Email address | A single address, confirmed by following a link Amazon SES emails to it | Getting started, and low-volume senders |
| Domain | A domain, confirmed by adding the DKIM CNAME records Amazon SES returns to your DNS | Production sending, and sending from many addresses at one domain |
This connector can do the same thing: createEmailIdentity starts the verification and returns the DKIM tokens to add to your DNS.
Note: A new account is in the Amazon SES sandbox, where mail can only be sent to verified addresses and the sending quota is low. Request production access from Account dashboard > Request production access before sending to arbitrary recipients.
Obtain IAM user credentials
To create an IAM user and generate an access key, follow the obtaining IAM user credentials guide.
Attach the Amazon SES permissions your application needs. Sending mail and reading the account's identities, lists, and templates requires:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ses:SendEmail", "ses:SendBulkEmail", "ses:SendCustomVerificationEmail" ], "Resource": "arn:aws:ses:<REGION>:<ACCOUNT_ID>:identity/<VERIFIED_IDENTITY>" }, { "Effect": "Allow", "Action": [ "ses:GetEmailIdentity", "ses:ListEmailIdentities", "ses:GetContactList", "ses:ListContactLists", "ses:ListContacts", "ses:GetContact", "ses:GetEmailTemplate", "ses:ListEmailTemplates", "ses:GetCustomVerificationEmailTemplate", "ses:ListCustomVerificationEmailTemplates" ], "Resource": "*" } ] }
Note: The list and template actions cannot be scoped to an identity ARN — AWS denies them when the resource is anything other than
*. Add the matchingCreate*,Update*, andDelete*actions only if your application manages these resources rather than just reading them.
Quickstart
To use the aws.ses connector in your Ballerina project, modify the .bal file as follows:
Step 1: Import the connector
Import ballerinax/aws & ballerinax/aws.ses packages into your Ballerina project.
import ballerinax/aws; import ballerinax/aws.ses;
Step 2: Instantiate a new connector
Create a new ses:Client by providing the region and authentication configurations.
configurable string accessKeyId = ?; configurable string secretAccessKey = ?; ses:Client ses = check new ({ region: aws:US_EAST_1, auth: { accessKeyId, secretAccessKey } });
Step 3: Invoke the connector operation
Send an email from a verified identity, then list the contacts already on the Newsletter contact list — sendEmail does not add its recipient to a list.
import ballerina/io; public function main() returns error? { // The "From" address has to be a verified identity in this account and region. Supplying both an HTML and a // text body lets each recipient's mail client pick the part it can display. ses:SendEmailOutput result = check ses->sendEmail({ fromEmailAddress: "sender@example.com", destination: {toAddresses: ["recipient@example.com"]}, content: { simple: { subject: {data: "Your order has shipped", charset: "UTF-8"}, body: { html: {data: "<html><body><p>It is on its way.</p></body></html>", charset: "UTF-8"}, text: {data: "It is on its way.", charset: "UTF-8"} } } } }); io:println("Message accepted: ", result.messageId); // Every list operation returns an auto-paginating stream; the next page is fetched only once this one is // consumed. stream<ses:Contact, ses:Error?> contacts = ses->listContacts("Newsletter", { filter: {filteredStatus: ses:OPT_IN} }); check from ses:Contact contact in contacts do { io:println(contact.emailAddress); }; // Releases the credential provider's refresh threads and any STS/SSO connections it opened. check ses.close(); }
Step 4: Run the Ballerina application
Use the following command to compile and run the Ballerina program.
bal run
Alternative authentication methods
Profile-based authentication
You can use AWS profile-based authentication as an alternative to static credentials.
ses:Client ses = check new ({ region: aws:US_EAST_1, auth: { profileName: "myAwsProfile", credentialsFilePath: "/path/to/custom/credentials" } });
Default credential provider chain
Resolves credentials automatically from the AWS SDK's default chain. This is the recommended option when the application runs on AWS infrastructure, since no long-lived credentials need to be stored with the application — and the only supported one where long-term access keys are unavailable (EC2 instance roles, ECS task roles, EKS Pod Identity/IRSA).
import ballerinax/aws.auth; ses:Client ses = check new ({ region: aws:US_EAST_1, auth: auth:DEFAULT_CREDENTIALS });
Note: Beyond the three options above, the
authfield also acceptsauth:AssumeRoleConfig(STS assume-role),auth:WebIdentityConfig(web identity / OIDC),auth:SsoAuthConfig(IAM Identity Center), andauth:ProcessAuthConfig(external credential process). See theBallerina AWSdocumentation for details.
Examples
The aws.ses connector provides practical examples illustrating usage in various scenarios. Explore these examples.
-
Send a transactional email This example shows how to send an order confirmation as a one-off HTML message, through a stored template, and as a bulk send with per-recipient replacement values.
-
Manage a contact list This example shows how to run a newsletter list end to end: create the list and its topic, subscribe contacts, send only to the ones opted in, and let the unsubscribe link maintain the list. It runs on the default credential provider chain, so it works unchanged on EC2, ECS, and EKS.
Clients
aws.ses: Client
The Ballerina Amazon SES connector provides the capability to send email and to manage the identities, contact lists, and templates an Amazon Simple Email Service account sends it with.
Constructor
Initializes the connector.
ses:Client ses = check new ({
auth: {
accessKeyId: "<AWS_ACCESS_KEY_ID>",
secretAccessKey: "<AWS_SECRET_ACCESS_KEY>"
},
region: aws:US_EAST_1
});
init (ConnectionConfig config)- config ConnectionConfig - Configuration required to initialize the client
createContactList
function createContactList(CreateContactListInput request) returns Error?Creates a contact list.
check ses->createContactList({contactListName: "Newsletter"});
Parameters
- request CreateContactListInput - The details of the contact list to create
Return Type
- Error? - An
Erroron failure, or else()
updateContactList
function updateContactList(string contactListName, UpdateContactListInput request) returns Error?Updates the metadata of a contact list. This operation does a complete replacement of the description and the topics.
check ses->updateContactList("Newsletter", {description: "Weekly product news"});
Parameters
- contactListName string - The name of the contact list
- request UpdateContactListInput - The details to replace the contact list's metadata with
Return Type
- Error? - An
Erroron failure, or else()
getContactList
function getContactList(string contactListName) returns ContactListDetails|ErrorReturns the metadata of a contact list. It does not return any information about the contacts in the list.
ses:ContactListDetails contactList = check ses->getContactList("Newsletter");
Parameters
- contactListName string - The name of the contact list
Return Type
- ContactListDetails|Error - The contact list's metadata, or an
Erroron failure
listContactLists
function listContactLists(ListContactListsInput request) returns stream<ContactList, Error?>Lists the contact lists available to the account, fetching each page as the previous one is consumed.
stream<ses:ContactList, ses:Error?> contactLists = ses->listContactLists();
Parameters
- request ListContactListsInput (default {}) - The details of the contact lists to list
Return Type
- stream<ContactList, Error?> - A stream of
ContactListvalues, which completes once every page has been consumed
deleteContactList
Deletes a contact list and every contact on it.
check ses->deleteContactList("Newsletter");
Parameters
- contactListName string - The name of the contact list
Return Type
- Error? - An
Erroron failure, or else()
createContact
function createContact(string contactListName, CreateContactInput request) returns Error?Creates a contact — an end user receiving the email — and adds them to a contact list.
check ses->createContact("Newsletter", {emailAddress: "reader@example.com"});
Parameters
- contactListName string - The name of the contact list to add the contact to
- request CreateContactInput - The details of the contact to create
Return Type
- Error? - An
Erroron failure, or else()
updateContact
function updateContact(string contactListName, string emailAddress, UpdateContactInput request) returns Error?Updates a contact's preferences for a list. It is not necessary to specify every existing topic preference, only the ones that need updating.
check ses->updateContact("Newsletter", "reader@example.com", {unsubscribeAll: true});
Parameters
- contactListName string - The name of the contact list the contact belongs to
- emailAddress string - The contact's email address
- request UpdateContactInput - The details to update the contact with
Return Type
- Error? - An
Erroron failure, or else()
getContact
function getContact(string contactListName, string emailAddress) returns ContactDetails|ErrorReturns a contact from a contact list.
ses:ContactDetails contact = check ses->getContact("Newsletter", "reader@example.com");
Parameters
- contactListName string - The name of the contact list the contact belongs to
- emailAddress string - The contact's email address
Return Type
- ContactDetails|Error - The contact, or an
Erroron failure
listContacts
function listContacts(string contactListName, ListContactsInput request) returns stream<Contact, Error?>Lists the contacts of a contact list, fetching each page as the previous one is consumed.
stream<ses:Contact, ses:Error?> contacts = ses->listContacts("Newsletter", { filter: {filteredStatus: ses:OPT_IN} });
Parameters
- contactListName string - The name of the contact list
- request ListContactsInput (default {}) - The details of the contacts to list
Return Type
deleteContact
Removes a contact from a contact list.
check ses->deleteContact("Newsletter", "reader@example.com");
Parameters
- contactListName string - The name of the contact list the contact belongs to
- emailAddress string - The contact's email address
Return Type
- Error? - An
Erroron failure, or else()
createCustomVerificationEmailTemplate
function createCustomVerificationEmailTemplate(CreateCustomVerificationEmailTemplateInput request) returns Error?Creates a custom verification email template.
check ses->createCustomVerificationEmailTemplate({ templateName: "SupplierVerification", fromEmailAddress: "sender@example.com", templateSubject: "Please confirm your email address", templateContent: "<html><body><p>Confirm your address.</p></body></html>", successRedirectionUrl: "https://example.com/verified", failureRedirectionUrl: "https://example.com/not-verified" });
Parameters
- request CreateCustomVerificationEmailTemplateInput - The details of the custom verification email template to create
Return Type
- Error? - An
Erroron failure, or else()
updateCustomVerificationEmailTemplate
function updateCustomVerificationEmailTemplate(string templateName, UpdateCustomVerificationEmailTemplateInput request) returns Error?Updates an existing custom verification email template.
check ses->updateCustomVerificationEmailTemplate("SupplierVerification", { fromEmailAddress: "sender@example.com", templateSubject: "Confirm your email address", templateContent: "<html><body><p>Confirm your address.</p></body></html>", successRedirectionUrl: "https://example.com/verified", failureRedirectionUrl: "https://example.com/not-verified" });
Parameters
- templateName string - The name of the custom verification email template to update
- request UpdateCustomVerificationEmailTemplateInput - The details to replace the template with
Return Type
- Error? - An
Erroron failure, or else()
getCustomVerificationEmailTemplate
function getCustomVerificationEmailTemplate(string templateName) returns CustomVerificationEmailTemplateDetails|ErrorReturns the custom verification email template of the given name.
ses:CustomVerificationEmailTemplateDetails template = check ses->getCustomVerificationEmailTemplate("SupplierVerification");
Parameters
- templateName string - The name of the custom verification email template to retrieve
Return Type
- CustomVerificationEmailTemplateDetails|Error - The custom verification email template, or an
Erroron failure
listCustomVerificationEmailTemplates
function listCustomVerificationEmailTemplates(ListCustomVerificationEmailTemplatesInput request) returns stream<CustomVerificationEmailTemplateMetadata, Error?>Lists the custom verification email templates of the account in the current AWS Region, fetching each page as the previous one is consumed.
stream<ses:CustomVerificationEmailTemplateMetadata, ses:Error?> templates = ses->listCustomVerificationEmailTemplates();
Parameters
- request ListCustomVerificationEmailTemplatesInput (default {}) - The details of the templates to list
Return Type
- stream<CustomVerificationEmailTemplateMetadata, Error?> - A stream of
CustomVerificationEmailTemplateMetadatavalues, which completes once every page has been consumed
deleteCustomVerificationEmailTemplate
Deletes an existing custom verification email template.
check ses->deleteCustomVerificationEmailTemplate("SupplierVerification");
Parameters
- templateName string - The name of the custom verification email template to delete
Return Type
- Error? - An
Erroron failure, or else()
createEmailTemplate
function createEmailTemplate(CreateEmailTemplateInput request) returns Error?Creates an email template, which lets one API call send a personalized message to each of many destinations.
check ses->createEmailTemplate({ templateName: "OrderShipped", templateContent: { subject: "Your order {{orderId}} has shipped", html: "<html><body><p>Hello {{name}}, your order is on its way.</p></body></html>", text: "Hello {{name}}, your order is on its way." } });
Parameters
- request CreateEmailTemplateInput - The details of the email template to create
Return Type
- Error? - An
Erroron failure, or else()
updateEmailTemplate
function updateEmailTemplate(string templateName, UpdateEmailTemplateInput request) returns Error?Updates an email template. This operation does a complete replacement of the template's content.
check ses->updateEmailTemplate("OrderShipped", { templateContent: {subject: "Your order is on its way", text: "Hello {{name}}."} });
Parameters
- templateName string - The name of the template
- request UpdateEmailTemplateInput - The content to replace the template's with
Return Type
- Error? - An
Erroron failure, or else()
getEmailTemplate
function getEmailTemplate(string templateName) returns EmailTemplateDetails|ErrorReturns the template of the given name, including its subject line, its HTML part, and its text part.
ses:EmailTemplateDetails template = check ses->getEmailTemplate("OrderShipped");
Parameters
- templateName string - The name of the template
Return Type
- EmailTemplateDetails|Error - The email template, or an
Erroron failure
listEmailTemplates
function listEmailTemplates(ListEmailTemplatesInput request) returns stream<EmailTemplateMetadata, Error?>Lists the email templates of the account in the current AWS Region, fetching each page as the previous one is consumed.
stream<ses:EmailTemplateMetadata, ses:Error?> templates = ses->listEmailTemplates();
Parameters
- request ListEmailTemplatesInput (default {}) - The details of the templates to list
Return Type
- stream<EmailTemplateMetadata, Error?> - A stream of
EmailTemplateMetadatavalues, which completes once every page has been consumed
deleteEmailTemplate
Deletes an email template.
check ses->deleteEmailTemplate("OrderShipped");
Parameters
- templateName string - The name of the template to delete
Return Type
- Error? - An
Erroron failure, or else()
createEmailIdentity
function createEmailIdentity(CreateEmailIdentityInput request) returns CreateEmailIdentityOutput|ErrorStarts the process of verifying an email identity — an email address or a domain that email is sent from. An
identity has to be verified before it can be used as a sending address. Verifying a domain without supplying
dkimSigningAttributes returns the DKIM tokens to add to the domain's DNS configuration.
ses:CreateEmailIdentityOutput identity = check ses->createEmailIdentity({ emailIdentity: "sender@example.com" });
Parameters
- request CreateEmailIdentityInput - The details of the email identity to create
Return Type
- CreateEmailIdentityOutput|Error - The identity's type, verification status, and DKIM attributes, or an
Erroron failure
getEmailIdentity
function getEmailIdentity(string emailIdentity) returns EmailIdentityDetails|ErrorReturns information about an identity, including its verification status, its sending authorization policies, its DKIM authentication status, and its custom MAIL FROM settings.
ses:EmailIdentityDetails identity = check ses->getEmailIdentity("sender@example.com");
Parameters
- emailIdentity string - The email address or domain of the identity
Return Type
- EmailIdentityDetails|Error - The email identity, or an
Erroron failure
listEmailIdentities
function listEmailIdentities(ListEmailIdentitiesInput request) returns stream<IdentityInfo, Error?>Lists the email identities associated with the AWS account, verified and unverified alike, fetching each page as the previous one is consumed.
stream<ses:IdentityInfo, ses:Error?> identities = ses->listEmailIdentities();
Parameters
- request ListEmailIdentitiesInput (default {}) - The details of the identities to list
Return Type
- stream<IdentityInfo, Error?> - A stream of
IdentityInfovalues, which completes once every page has been consumed
deleteEmailIdentity
Deletes an email identity.
check ses->deleteEmailIdentity("sender@example.com");
Parameters
- emailIdentity string - The email address or domain of the identity to delete
Return Type
- Error? - An
Erroron failure, or else()
sendEmail
function sendEmail(SendEmailInput request) returns SendEmailOutput|ErrorSends an email message. The message may be simple — a subject and a body that Amazon SES assembles — raw,
a MIME message carrying its own headers and any attachments, or template, whose personalization tags Amazon
SES replaces with the values supplied.
ses:SendEmailOutput result = check ses->sendEmail({ fromEmailAddress: "sender@example.com", destination: {toAddresses: ["recipient@example.com"]}, content: { simple: { subject: {data: "Your order has shipped"}, body: {html: {data: "<html><body><p>It is on its way.</p></body></html>"}} } } });
Parameters
- request SendEmailInput - The details of the message to send
Return Type
- SendEmailOutput|Error - The identifier of the accepted message, or an
Erroron failure
sendCustomVerificationEmail
function sendCustomVerificationEmail(SendCustomVerificationEmailInput request) returns SendEmailOutput|ErrorAdds an email address to the account's identities and sends it a custom verification email. A custom verification email template has to exist before this operation can be used.
ses:SendEmailOutput result = check ses->sendCustomVerificationEmail({ emailAddress: "supplier@example.com", templateName: "SupplierVerification" });
Parameters
- request SendCustomVerificationEmailInput - The details of the verification email to send
Return Type
- SendEmailOutput|Error - The identifier of the accepted message, or an
Erroron failure
sendBulkEmail
function sendBulkEmail(SendBulkEmailInput request) returns SendBulkEmailOutput|ErrorComposes a templated email message to many destinations. Each entry carries its own recipients and its own replacement values; the result carries one outcome per entry, in the order the entries were given.
ses:SendBulkEmailOutput result = check ses->sendBulkEmail({ fromEmailAddress: "sender@example.com", defaultContent: {template: {templateName: "OrderShipped", templateData: "{\"name\":\"there\"}"}}, bulkEmailEntries: [{destination: {toAddresses: ["recipient@example.com"]}}] });
Parameters
- request SendBulkEmailInput - The details of the messages to send
Return Type
- SendBulkEmailOutput|Error - One result per intended recipient, or an
Erroron failure
close
function close() returns Error?Releases the resources held by the client: the credential provider's background refresh threads, and any HTTP connections it opened to resolve credentials through STS or SSO. This is a normal method rather than a remote method, since closing the client sends no request to Amazon SES.
check ses.close();
Return Type
- Error? - An
Erroron failure, or else()
Enums
aws.ses: BehaviorOnMxFailure
Represents the action to take if the required MX record cannot be found when an email is sent.
Members
amazonses.com as the MAIL FROM domainMailFromDomainNotVerified error and does not send the emailaws.ses: IdentityType
Represents the type of an email identity.
Members
aws.ses: SigningAttributesOrigin
Represents how DKIM was configured for an identity.
Members
aws.ses: SigningKeyLength
Represents the length of the DKIM signing key.
Members
aws.ses: SubscriptionStatus
Represents a contact's preference for being opted in to or out of a topic.
Members
aws.ses: VerificationStatus
Represents the verification status of an email identity.
Members
Records
aws.ses: Attachment
Represents a file attached to an email message.
Fields
- fileName string - The file name of the attachment, as it appears to the recipient
- rawContent byte[] - The raw content of the attachment
- contentType? string - The MIME content type of the attachment
- contentDisposition? string - Whether the attachment is displayed inline or offered as a download
- contentDescription? string - A description of the attachment
- contentId? string - An identifier for the attachment, which an HTML body can reference with a
cid:URL
- contentTransferEncoding? string - The transfer encoding of the attachment
aws.ses: Body
Represents the body of an email message. Supply the HTML part, the text part, or both — a message with both lets each recipient's email client pick the part it can display.
Fields
- html? Content - The HTML body of the email
- text? Content - The body visible to recipients whose email clients do not display HTML
aws.ses: BulkEmailContent
Represents the template to use for a bulk email message.
Fields
- template? TemplatedEmail - The template to use for every message in the request
aws.ses: BulkEmailEntry
Represents one recipient of a bulk email message.
Fields
- destination Destination - The recipients of this message
- replacementEmailContent? ReplacementEmailContent - The message content replacing the default for this recipient
- replacementHeaders? MessageHeader[] - The headers replacing the default ones for this recipient
- replacementTags? MessageTag[] - The tags replacing the default ones for this recipient
aws.ses: BulkEmailEntryResult
Represents the outcome of sending a bulk email message to one recipient.
Fields
- status? string - The status of the message
- messageId? string - A unique identifier for the message, generated when the message is accepted
- 'error? string - A description of the error that prevented the message from being sent
aws.ses: ConfigurationOverrides
Represents settings that override, for this message only, the ones that would otherwise apply to it.
Fields
- tracking? TrackingOptions - The open and click tracking settings to apply
aws.ses: ConnectionConfig
Represents the configurations required to initialize the Amazon SES client.
Fields
- auth AuthConfig - Authentication configuration: any standard credential source supported by AWS — static credentials, an AWS profile, STS assume-role, web identity (OIDC), IAM Identity Center (SSO), an external credential process, or the default credential provider chain
- endpoint? EndpointConfig - Optional endpoint options: FIPS/dualstack variants, or a custom endpoint override (e.g. LocalStack, VPC interface endpoints)
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 30) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- followRedirects? FollowRedirects - Configurations associated with Redirection
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- cookieConfig? CookieConfig - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- socketConfig ClientSocketConfig(default {}) - Provides settings related to client socket configuration
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
- laxDataBinding boolean(default true) - Enables relaxed data binding on the client side. When enabled,
nilvalues are treated as optional, and absent fields are handled asnilabletypes. Enabled by default
aws.ses: Contact
Represents a contact returned by listContacts. The attribute data and the contact list name are not listed; call
getContact for those.
Fields
- emailAddress? string - The contact's email address
- topicPreferences? TopicPreference[] - The contact's preferences for being opted in to or out of topics
- topicDefaultPreferences? TopicPreference[] - The default topic preferences applied to the contact
- unsubscribeAll? boolean - Whether the contact is unsubscribed from all of the contact list's topics
- lastUpdatedTimestamp? decimal - A timestamp noting the last time the contact was updated, in UNIX epoch time format
aws.ses: ContactDetails
Represents a contact, as returned by getContact.
Fields
- emailAddress? string - The contact's email address
- contactListName? string - The name of the contact list to which the contact belongs
- attributesData? string - The attribute data attached to the contact, as a JSON string
- topicPreferences? TopicPreference[] - The contact's preferences for being opted in to or out of topics
- topicDefaultPreferences? TopicPreference[] - The default topic preferences applied to the contact
- unsubscribeAll? boolean - Whether the contact is unsubscribed from all of the contact list's topics
- createdTimestamp? decimal - A timestamp noting when the contact was created, in UNIX epoch time format
- lastUpdatedTimestamp? decimal - A timestamp noting the last time the contact was updated, in UNIX epoch time format
aws.ses: ContactList
Represents a contact list returned by listContactLists. Only the name and the update timestamp are listed; call
getContactList for the description, the topics, and the tags.
Fields
- contactListName? string - The name of the contact list
- lastUpdatedTimestamp? decimal - A timestamp noting the last time the contact list was updated, in UNIX epoch time format
aws.ses: ContactListDetails
Represents the metadata of a contact list, as returned by getContactList.
Fields
- contactListName? string - The name of the contact list
- description? string - A description of what the contact list is about
- topics? Topic[] - The topics of the contact list
- tags? Tag[] - The tags associated with the contact list
- createdTimestamp? decimal - A timestamp noting when the contact list was created, in UNIX epoch time format
- lastUpdatedTimestamp? decimal - A timestamp noting the last time the contact list was updated, in UNIX epoch time format
aws.ses: Content
Represents a block of text in an email message, with the character set it is written in.
Fields
- data string - The content of the message itself
- charset? string - The character set of the content. Amazon SES uses 7-bit ASCII by default, so a character set has to be given
whenever the text includes characters outside the ASCII range — for example
UTF-8orISO-8859-1
aws.ses: CreateContactInput
Represents the fields of a createContact request.
Fields
- emailAddress string - The contact's email address
- attributesData? string - The attribute data attached to the contact, as a JSON string
- topicPreferences? TopicPreference[] - The contact's preferences for being opted in to or out of topics
- unsubscribeAll? boolean - Whether the contact is unsubscribed from all of the contact list's topics
aws.ses: CreateContactListInput
Represents the fields of a createContactList request.
Fields
- contactListName string - The name of the contact list
- description? string - A description of what the contact list is about
- topics? Topic[] - The topics of the contact list
- tags? Tag[] - The tags to associate with the contact list
aws.ses: CreateCustomVerificationEmailTemplateInput
Represents the fields of a createCustomVerificationEmailTemplate request.
Fields
- templateName string - The name of the custom verification email template
- fromEmailAddress string - The email address the custom verification email is sent from
- templateSubject string - The subject line of the custom verification email
- templateContent string - The content of the custom verification email, as an HTML string
- successRedirectionUrl string - The URL the recipient is sent to if their address is successfully verified
- failureRedirectionUrl string - The URL the recipient is sent to if their address is not successfully verified
aws.ses: CreateEmailIdentityInput
Represents the fields of a createEmailIdentity request.
Fields
- emailIdentity string - The email address or domain to verify
- configurationSetName? string - The configuration set to use by default when sending from this identity
- dkimSigningAttributes? DkimSigningAttributes - The DKIM signing configuration to apply. This may only be given for a domain identity, not an email address
- tags? Tag[] - The tags to associate with the email identity
aws.ses: CreateEmailIdentityOutput
Represents the result of a createEmailIdentity request.
Fields
- identityType? IdentityType - The email identity type
- verifiedForSendingStatus? boolean - Whether the identity is verified, and so usable as a sending address
- dkimAttributes? DkimAttributes - The DKIM attributes of the identity, carrying the tokens to add to the domain's DNS configuration
aws.ses: CreateEmailTemplateInput
Represents the fields of a createEmailTemplate request.
Fields
- templateName string - The name of the template
- templateContent EmailTemplateContent - The content of the email template
aws.ses: CustomVerificationEmailTemplateDetails
Represents a custom verification email template, as returned by getCustomVerificationEmailTemplate.
Fields
- templateName? string - The name of the custom verification email template
- fromEmailAddress? string - The email address the custom verification email is sent from
- templateSubject? string - The subject line of the custom verification email
- templateContent? string - The content of the custom verification email, as an HTML string
- successRedirectionUrl? string - The URL the recipient is sent to if their address is successfully verified
- failureRedirectionUrl? string - The URL the recipient is sent to if their address is not successfully verified
- tags? Tag[] - The tags associated with the custom verification email template
aws.ses: CustomVerificationEmailTemplateMetadata
Represents a custom verification email template returned by listCustomVerificationEmailTemplates. The template
content is not listed; call getCustomVerificationEmailTemplate for it.
Fields
- templateName? string - The name of the custom verification email template
- fromEmailAddress? string - The email address the custom verification email is sent from
- templateSubject? string - The subject line of the custom verification email
- successRedirectionUrl? string - The URL the recipient is sent to if their address is successfully verified
- failureRedirectionUrl? string - The URL the recipient is sent to if their address is not successfully verified
aws.ses: Destination
Represents the recipients of an email message.
Fields
- toAddresses? string[] - The email addresses of the "To" recipients
- ccAddresses? string[] - The email addresses of the "CC" (carbon copy) recipients
- bccAddresses? string[] - The email addresses of the "BCC" (blind carbon copy) recipients
aws.ses: DkimAttributes
Represents the DKIM authentication status of an email identity.
Fields
- signingAttributesOrigin? SigningAttributesOrigin - How DKIM was configured for the identity
- signingEnabled? boolean - Whether the messages sent from the identity are signed using DKIM
- status? DkimStatus - Whether Amazon SES has located the DKIM records in the DNS configuration for the domain
- tokens? string[] - The tokens used in DKIM authentication, which are converted into CNAME records in the domain's DNS
- currentSigningKeyLength? SigningKeyLength - The key length of the DKIM key pair in use
- nextSigningKeyLength? SigningKeyLength - The key length of the future DKIM key pair to be generated
- lastKeyGenerationTimestamp? decimal - A timestamp noting when the DKIM key pair was generated, in UNIX epoch time format
- signingHostedZone? string - The hosted zone of the DKIM records, for identities configured through Route 53
aws.ses: DkimSigningAttributes
Represents the DKIM signing configuration to apply to an identity. Supply domainSigningSelector and
domainSigningPrivateKey to use Bring Your Own DKIM (BYODKIM), or nextSigningKeyLength alone to configure the
key length of Easy DKIM.
Fields
- domainSigningSelector? string - A string identifying the public key in the domain's DNS configuration
- domainSigningPrivateKey? string - The private key used to generate a DKIM signature, in PKCS#8 PEM form, base64 encoded
- domainSigningAttributesOrigin? SigningAttributesOrigin - How DKIM is to be configured for the identity
- nextSigningKeyLength? SigningKeyLength - The key length of the DKIM key pair to be generated for Easy DKIM
aws.ses: EmailContent
Represents the body of an email message. Exactly one of simple, raw, or template is to be supplied.
Fields
- simple? SimpleEmail - A standard message, which Amazon SES assembles from the subject and body given here
- raw? RawEmail - A raw, MIME-formatted message
- template? TemplatedEmail - A templated message
aws.ses: EmailIdentityDetails
Represents an email identity, as returned by getEmailIdentity.
Fields
- identityType? IdentityType - The email identity type
- verificationStatus? VerificationStatus - The verification status of the identity
- verifiedForSendingStatus? boolean - Whether the identity is verified, and so usable as a sending address
- verificationInfo? VerificationInfo - Additional information about the verification status
- dkimAttributes? DkimAttributes - The DKIM attributes of the identity
- mailFromAttributes? MailFromAttributes - The custom MAIL FROM configuration of the identity
- configurationSetName? string - The configuration set used by default when sending from this identity
- feedbackForwardingStatus? boolean - Whether bounce and complaint notifications are forwarded by email
- tags? Tag[] - The tags associated with the email identity
aws.ses: EmailTemplateContent
Represents the content of an email template, composed of a subject line, an HTML part, and a text-only part.
Fields
- subject? string - The subject line of the email
- html? string - The HTML body of the email
- text? string - The email body visible to recipients whose email clients do not display HTML
aws.ses: EmailTemplateDetails
Represents an email template, as returned by getEmailTemplate.
Fields
- templateName? string - The name of the template
- templateContent? EmailTemplateContent - The content of the email template
- tags? Tag[] - The tags associated with the email template
aws.ses: EmailTemplateMetadata
Represents the name and creation timestamp of an email template, as returned by listEmailTemplates.
Fields
- templateName? string - The name of the template
- createdTimestamp? decimal - A timestamp noting when the template was created, in UNIX epoch time format
aws.ses: IdentityInfo
Represents an email identity returned by listEmailIdentities.
Fields
- identityName? string - The address or domain of the identity
- identityType? IdentityType - The email identity type
- sendingEnabled? boolean - Whether email can be sent from the identity
- verificationStatus? VerificationStatus - The verification status of the identity
aws.ses: ListContactListsInput
Represents the fields of a listContactLists request.
Fields
- pageSize? int - The maximum number of contact lists a single page may carry
aws.ses: ListContactsFilter
Represents a filter applied to a listContacts request.
Fields
- filteredStatus? SubscriptionStatus - Restricts the result to contacts with this subscription status
- topicFilter? TopicFilter - Restricts the result to contacts with a preference for a specific topic
aws.ses: ListContactsInput
Represents the fields of a listContacts request.
Fields
- filter? ListContactsFilter - A filter restricting which contacts are returned
- pageSize? int - The maximum number of contacts a single page may carry
aws.ses: ListCustomVerificationEmailTemplatesInput
Represents the fields of a listCustomVerificationEmailTemplates request.
Fields
- pageSize? int - The maximum number of templates a single page may carry, between 1 and 50
aws.ses: ListEmailIdentitiesInput
Represents the fields of a listEmailIdentities request.
Fields
- pageSize? int - The maximum number of identities a single page may carry, up to 1000
aws.ses: ListEmailTemplatesInput
Represents the fields of a listEmailTemplates request.
Fields
- pageSize? int - The maximum number of templates a single page may carry, between 1 and 100
aws.ses: ListManagementOptions
Represents the contact list and topic an email belongs to, used when a recipient chooses to unsubscribe.
Fields
- contactListName string - The name of the contact list
- topicName? string - The name of the topic
aws.ses: MailFromAttributes
Represents the custom MAIL FROM configuration of an email identity.
Fields
- mailFromDomain? string - The name of the domain the identity uses as its custom MAIL FROM domain
- mailFromDomainStatus? string - The status of the MAIL FROM domain
- behaviorOnMxFailure? BehaviorOnMxFailure - The action to take if the required MX record cannot be found when an email is sent
aws.ses: MessageHeader
Represents a custom header applied to an email message.
Fields
- name string - The name of the header
- value string - The value of the header
aws.ses: MessageTag
Represents the name and value of a tag applied to an email.
Fields
- name string - The name of the message tag
- value string - The value of the message tag
aws.ses: RawEmail
Represents a raw, MIME-formatted email message. The message has to be a valid MIME message, carrying all of its own headers as well as its body.
Fields
- data byte[] - The raw MIME content of the message
aws.ses: ReplacementEmailContent
Represents the message content that replaces the default for one recipient of a bulk email.
Fields
- replacementTemplate? ReplacementTemplate - The template values for this recipient
aws.ses: ReplacementTemplate
Represents the template values that replace the defaults for one recipient of a bulk email.
Fields
- replacementTemplateData? string - The values for the template's message variables, as a JSON string
aws.ses: SendBulkEmailInput
Represents the fields of a sendBulkEmail request.
Fields
- bulkEmailEntries BulkEmailEntry[] - One entry per intended recipient
- defaultContent BulkEmailContent - The template used for every message in the request, unless a
BulkEmailEntryreplaces it
- fromEmailAddress? string - The email address to use as the "From" address. The address has to be a verified identity
- fromEmailAddressIdentityArn? string - The ARN of the identity carrying the sending authorization policy that permits the use of
fromEmailAddress
- replyToAddresses? string[] - The "Reply-to" addresses. A recipient replying to a message replies to each of these
- feedbackForwardingEmailAddress? string - The address bounce and complaint notifications are sent to
- feedbackForwardingEmailAddressIdentityArn? string - The ARN of the identity carrying the sending authorization policy that permits the use of
feedbackForwardingEmailAddress
- configurationSetName? string - The name of the configuration set to use when sending the emails
- configurationOverrides? ConfigurationOverrides - Settings overriding, for these messages only, the ones that would otherwise apply
- defaultEmailTags? MessageTag[] - The tags to apply to every email, unless a
BulkEmailEntryreplaces them
- endpointId? string - The ID of the multi-region endpoint to send through
- tenantName? string - The name of the tenant to send through. Every identity, configuration set, and template the request refers to has to be associated with this tenant
aws.ses: SendBulkEmailOutput
Represents the result of a sendBulkEmail request.
Fields
- bulkEmailEntryResults BulkEmailEntryResult[](default []) - One result per intended recipient, in the order the entries were given. Check each one and retry the messages that carry a failure status
aws.ses: SendCustomVerificationEmailInput
Represents the fields of a sendCustomVerificationEmail request.
Fields
- emailAddress string - The email address to verify
- templateName string - The name of the custom verification email template to use
- configurationSetName? string - The name of the configuration set to use when sending the verification email
aws.ses: SendEmailInput
Represents the fields of a sendEmail request.
Fields
- content EmailContent - The body of the message: a simple, a raw, or a templated message
- destination? Destination - The recipients of the message
- fromEmailAddress? string - The email address to use as the "From" address. The address has to be a verified identity
- fromEmailAddressIdentityArn? string - The ARN of the identity carrying the sending authorization policy that permits the use of
fromEmailAddress
- replyToAddresses? string[] - The "Reply-to" addresses. A recipient replying to the message replies to each of these
- feedbackForwardingEmailAddress? string - The address bounce and complaint notifications are sent to
- feedbackForwardingEmailAddressIdentityArn? string - The ARN of the identity carrying the sending authorization policy that permits the use of
feedbackForwardingEmailAddress
- configurationSetName? string - The name of the configuration set to use when sending the email
- configurationOverrides? ConfigurationOverrides - Settings overriding, for this message only, the ones that would otherwise apply
- emailTags? MessageTag[] - The tags to apply to the email, so that sending events can be published against them
- listManagementOptions? ListManagementOptions - The contact list and topic the email belongs to, used when a recipient unsubscribes
- endpointId? string - The ID of the multi-region endpoint to send through
- tenantName? string - The name of the tenant to send through. Every identity, configuration set, and template the request refers to has to be associated with this tenant
aws.ses: SendEmailOutput
Represents the result of a sendEmail or a sendCustomVerificationEmail request.
Fields
- messageId? string - A unique identifier for the message, generated when the message is accepted. Amazon SES can accept a message without going on to send it — for example when an attachment contains a virus
aws.ses: SimpleEmail
Represents a standard email message, which Amazon SES assembles from its parts.
Fields
- subject? Content - The subject line of the email
- body? Body - The body of the message
- headers? MessageHeader[] - The custom headers to apply to the message
- attachments? Attachment[] - The files to attach to the message
aws.ses: SoaRecord
Represents the start-of-authority (SOA) record of a domain, reported when verification fails because of a DNS configuration problem.
Fields
- primaryNameServer? string - The primary name server of the domain
- adminEmail? string - The email address of the domain administrator
- serialNumber? int - The serial number of the SOA record
aws.ses: Tag
Represents a key-value pair associated with an Amazon SES resource.
Fields
- key string - One part of a key-value pair that defines a tag, between 1 and 128 characters long
- value string - The optional part of a key-value pair that defines a tag, up to 256 characters long
aws.ses: TemplatedEmail
Represents a templated email message, whose personalization tags Amazon SES replaces with the supplied values.
Fields
- templateName? string - The name of the template to use
- templateArn? string - The Amazon Resource Name (ARN) of the template to use
- templateContent? EmailTemplateContent - The content of an inline template, used instead of a stored one
- templateData? string - The values for the template's message variables, as a JSON string
- headers? MessageHeader[] - The custom headers to apply to the message
- attachments? Attachment[] - The files to attach to the message
aws.ses: Topic
Represents an interest group, theme, or label within a contact list.
Fields
- topicName string - The name of the topic
- displayName string - The name of the topic the contact will see
- defaultSubscriptionStatus SubscriptionStatus - The subscription status applied to a contact that has not noted a preference for this topic
- description? string - A description of what the topic is about, which the contact will see
aws.ses: TopicFilter
Represents the subscription status a contact must have for a topic to be included in a listContacts result.
Fields
- topicName? string - The name of the topic to filter on
- useDefaultIfPreferenceUnavailable? boolean - Whether to apply the topic's default subscription status to contacts that have noted no preference for it
aws.ses: TopicPreference
Represents a contact's preference for being opted in to or out of a topic.
Fields
- topicName string - The name of the topic
- subscriptionStatus SubscriptionStatus - The contact's subscription status to the topic
aws.ses: TrackingOptions
Represents the open and click tracking settings applied to a message.
Fields
- openTrackingEnabled? string - Whether to track opens of the message
- clickTrackingEnabled? string - Whether to track clicks of the links in the message
aws.ses: UpdateContactInput
Represents the fields of an updateContact request. It is not necessary to specify every existing topic
preference, only the ones that need updating.
Fields
- attributesData? string - The attribute data attached to the contact, as a JSON string
- topicPreferences? TopicPreference[] - The contact's preferences for being opted in to or out of topics
- unsubscribeAll? boolean - Whether the contact is unsubscribed from all of the contact list's topics
aws.ses: UpdateContactListInput
Represents the fields of an updateContactList request. This operation does a complete replacement of the
description and the topics.
Fields
- description? string - A description of what the contact list is about
- topics? Topic[] - The topics of the contact list
aws.ses: UpdateCustomVerificationEmailTemplateInput
Represents the fields of an updateCustomVerificationEmailTemplate request.
Fields
- fromEmailAddress string - The email address the custom verification email is sent from
- templateSubject string - The subject line of the custom verification email
- templateContent string - The content of the custom verification email, as an HTML string
- successRedirectionUrl string - The URL the recipient is sent to if their address is successfully verified
- failureRedirectionUrl string - The URL the recipient is sent to if their address is not successfully verified
aws.ses: UpdateEmailTemplateInput
Represents the fields of an updateEmailTemplate request.
Fields
- templateContent EmailTemplateContent - The content of the email template
aws.ses: VerificationInfo
Represents additional information about the verification status of an identity.
Fields
- errorType? string - The reason the verification failed
- lastCheckedTimestamp? decimal - A timestamp noting when the verification status was last checked, in UNIX epoch time format
- lastSuccessTimestamp? decimal - A timestamp noting when the identity was last successfully verified, in UNIX epoch time format
- soaRecord? SoaRecord - The start-of-authority record of the domain
Errors
aws.ses: Error
Represents the generic error type for the aws.ses module.
aws.ses: RequestGenerationError
Represents an error that occurs while generating an API request, before anything is sent.
aws.ses: ResponseHandlingError
Represents an error that occurs when the API response cannot be handled.
Simple name reference types
aws.ses: DkimStatus
DkimStatus
Represents whether Amazon SES has located the DKIM records in the DNS configuration for a domain. Its values are
the same as those of VerificationStatus.
aws.ses: MailFromDomainStatus
MailFromDomainStatus
Represents the status of a custom MAIL FROM domain. Its values are those of VerificationStatus except
NOT_STARTED, which a MAIL FROM domain never reports.
Import
import ballerinax/aws.ses;Metadata
Released date: 9 days ago
Version: 3.0.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.12.0
GraalVM compatible: Yes
Pull count
Total: 2432
Current verison: 2
Weekly downloads
Keywords
Vendor/Amazon
Area/Marketing & Social Media
Type/Connector
Contributors