Cameleer

AWS SES component

The aws2-ses component sends e-mails (text, HTML or raw MIME) with Amazon Simple Email Service.

Scheme: aws2-ses: · Crate: cameleer-cloud · Cargo feature: cloud · Consumer: no · Producer: yes · Apache Camel: AWS Simple Email Service (SES)

When to use it

  • Send notifications and alerts from routes without running an SMTP server.
  • Send transactional mails (order confirmations, password resets) from events.
  • Forward complete MIME messages built by another system (SendRawEmail).

URI format

text
aws2-ses://from@example.com[?options]

The path is the sender address; it must be verified in SES.

Example

Mail every alert of a queue to the on-call address:

yaml example: aws2-ses-mail-alerts
- route:
    id: mail-alerts
    from:
      uri: "aws2-sqs://alerts?region={{env:AWS_REGION:us-east-1}}"
      steps:
        - to: "aws2-ses://{{env:ALERT_SENDER:alerts@example.com}}?region={{env:AWS_REGION:us-east-1}}&to={{env:ONCALL_ADDRESS:oncall@example.com}}&subject=Production alert"
        - log: "sent mail ${header.CamelAwsSesMessageId}"

A text body is sent with SendEmail (as HTML with htmlEmail=true); a bytes body is sent as a complete MIME message with SendRawEmail.

Rust DSL

rust
ctx.add_routes(|b| {
    b.from("aws2-sqs://alerts?region={{env:AWS_REGION:us-east-1}}")
        .to("aws2-ses://{{env:ALERT_SENDER:alerts@example.com}}?region={{env:AWS_REGION:us-east-1}}&to={{env:ONCALL_ADDRESS:oncall@example.com}}&subject=Production alert")
        .log("sent mail ${header.CamelAwsSesMessageId}");
})?;

Options

Common AWS options (region, credentials, endpoint override, proxy) are listed in Cloud credentials.

optiondefaultdescription
to, cc, bccRecipients (comma separated).
subjectSubject.
replyToAddressesReply-to addresses.
returnPathBounce address.
configurationSetSES configuration set.
htmlEmailfalseSend the body as HTML.

Message headers

headerdirectiondescription
CamelAwsSesFrominOverrides the sender.
CamelAwsSesTo, CamelAwsSesCc, CamelAwsSesBccinRecipients (list or comma separated).
CamelAwsSesSubject, CamelAwsSesReturnPath, CamelAwsSesReplyToAddresses, CamelAwsSesConfigurationSetinOverride the options.
CamelAwsSesHtmlEmailinSend as HTML.
CamelAwsSesMessageIdoutId of the sent mail.

Run it with Docker

sh
docker run --rm -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e ALERT_SENDER -e ONCALL_ADDRESS \
  -v "$PWD:/routes:ro" pmsudhi/cameleer run /routes/alerts.camel.yaml

Common questions

How do I send attachments?

Build a MIME message (for example with the mime-multipart data format) and send it as bytes: it then goes out with SendRawEmail.

Which SES API is used?

SES v1 (SendEmail / SendRawEmail over the Query API), as in Apache Camel's component.

Found a problem?

If something on this page doesn't match what Cameleer does, or you hit a bug while building with it, please help fix it, whether you are a person or a coding agent: open an issue that describes what you saw, then fork the repository, fix it, add or update a test, run cargo test --workspace, and open a pull request. CONTRIBUTING.md explains the ground rules.

Edit this page on GitHub