Migrate from Amazon SES¶
FrontEngine has an interface compatible with the sending operations of Amazon SES. You keep the AWS SDK and the sending code, and change two things: the endpoint and the credentials.
Compatibility covers sending. Identity management, templates, contact lists and SNS notifications are not part of it.
What changes¶
| Item | On Amazon SES | On FrontEngine |
|---|---|---|
| Endpoint | https://email.<region>.amazonaws.com | https://api.frontengine.net |
| Access key ID | an IAM user's | the identifier of the server credential |
| Secret access key | an IAM user's | the key of the server credential |
| Region | your account's | any. The SDK requires a value, and FrontEngine accepts any region in the signature |
| Domain verification | identities in SES | domain verified on FrontEngine, through the DNS records we send |
| Events | SNS, EventBridge | FrontEngine webhooks |
Requests are still signed with Signature Version 4, which the SDK computes by itself. The machine's clock must be correct: a signature more than 15 minutes off is refused.
Examples¶
import os
import boto3
ses = boto3.client(
"sesv2",
endpoint_url="https://api.frontengine.net",
region_name="us-east-1",
aws_access_key_id=os.environ["FRONTENGINE_KEY_ID"],
aws_secret_access_key=os.environ["FRONTENGINE_KEY"],
)
result = ses.send_email(
FromEmailAddress="My Store <[email protected]>",
Destination={"ToAddresses": ["[email protected]"]},
Content={
"Simple": {
"Subject": {"Data": "Your order is confirmed"},
"Body": {
"Text": {"Data": "We received your order 1234."},
"Html": {"Data": "<p>We received your order <strong>1234</strong>.</p>"},
},
}
},
)
print(result["MessageId"])
import { SESv2Client, SendEmailCommand } from "@aws-sdk/client-sesv2";
const ses = new SESv2Client({
endpoint: "https://api.frontengine.net",
region: "us-east-1",
credentials: {
accessKeyId: process.env.FRONTENGINE_KEY_ID,
secretAccessKey: process.env.FRONTENGINE_KEY,
},
});
const result = await ses.send(
new SendEmailCommand({
FromEmailAddress: "My Store <[email protected]>",
Destination: { ToAddresses: ["[email protected]"] },
Content: {
Simple: {
Subject: { Data: "Your order is confirmed" },
Body: {
Text: { Data: "We received your order 1234." },
Html: { Data: "<p>We received your order <strong>1234</strong>.</p>" },
},
},
},
}),
);
console.log(result.MessageId);
AWS_ACCESS_KEY_ID="$FRONTENGINE_KEY_ID" \
AWS_SECRET_ACCESS_KEY="$FRONTENGINE_KEY" \
aws sesv2 send-email \
--endpoint-url https://api.frontengine.net \
--region us-east-1 \
--from-email-address "[email protected]" \
--destination "[email protected]" \
--content '{"Simple":{"Subject":{"Data":"Test"},"Body":{"Text":{"Data":"Test through FrontEngine"}}}}'
import os
import boto3
ses = boto3.client(
"ses",
endpoint_url="https://api.frontengine.net",
region_name="us-east-1",
aws_access_key_id=os.environ["FRONTENGINE_KEY_ID"],
aws_secret_access_key=os.environ["FRONTENGINE_KEY"],
)
result = ses.send_email(
Source="[email protected]",
Destination={"ToAddresses": ["[email protected]"]},
Message={
"Subject": {"Data": "Your order is confirmed"},
"Body": {"Text": {"Data": "We received your order 1234."}},
},
)
print(result["MessageId"])
In other AWS SDKs, the change is the same: set the endpoint (endpoint_url, endpoint, endpointOverride or ServiceURL, depending on the language) and pass the FrontEngine credentials.
Do not pick up the environment's default credentials by mistake
If the application runs on AWS, the SDK looks for credentials by itself in the instance or container profile. Pass the FrontEngine credentials explicitly to the SES client, so that the other AWS clients in the same application keep using the AWS credentials.
Supported operations¶
| API | Operation | Note |
|---|---|---|
| SES v2 | SendEmail (POST /v2/email/outbound-emails) with Simple content | Subject, text, HTML, headers and attachments |
| SES v2 | SendEmail with Raw content | Complete MIME message |
| SES v2 | GetAccount (GET /v2/email/account) | Used by libraries as a health check. Quota values are constants |
| SES v1 | SendEmail | |
| SES v1 | SendRawEmail | |
| SES v1 | GetSendQuota | Values are constants |
Behavior that matches SES:
- a limit of 50 recipients per message;
- in a
Rawmessage with no destination list, recipients are read from theTo,CcandBccheaders, andBccis removed; - the answer carries
MessageId, and the message'sMessage-IDheader is replaced with<MessageId@sender-domain>; - errors follow the SES format: in v2, HTTP code,
x-amzn-ErrorTypeheader and body{"message": "..."}. In v1,<ErrorResponse>XML.
Unsupported operations and fields¶
| SES feature | On FrontEngine |
|---|---|
Templates (Content.Template, SendTemplatedEmail) | Refused. Build the content in your application and send it as Simple or Raw |
Bulk sending (SendBulkEmail, /v2/email/outbound-bulk-emails) | Refused. Make one call per message |
ListManagementOptions and contact lists | Refused |
Inline attachments (ContentDisposition other than ATTACHMENT) in Simple content | Refused. For inline images, send the message as Raw |
| Identities, configuration sets, account suppression lists, VDM and the other management operations | Refused with BadRequestException (v2) or InvalidAction (v1) |
| Temporary STS credentials (session token) | Not accepted. Use the credential's identifier and key |
| Presigned URLs and SigV4a | Not accepted |
| SNS notifications and event destinations | They do not exist. Use FrontEngine webhooks |
Fields accepted with different behavior:
| Field | Behavior |
|---|---|
ConfigurationSetName | Accepted. It becomes the message's tag. It does not select a configuration set |
EmailTags / Tags | Accepted. When there is no ConfigurationSetName, they become the message's tag |
ReturnPath, FeedbackForwardingEmailAddress | Accepted and ignored. The return address is FrontEngine's, and failures arrive by webhook |
X-SES-CONFIGURATION-SET and X-SES-MESSAGE-TAGS headers (SMTP) | Read to set the tag. They are not removed from the message |
Events: from SNS to webhooks¶
FrontEngine does not emit notifications in the SNS format. Event handling has to be rewritten for webhooks.
| SES notification | FrontEngine event |
|---|---|
Delivery | MessageSent |
DeliveryDelay | MessageDelayed |
Bounce (permanent) | MessageDeliveryFailed or MessageBounced |
Reject | error answer on the send call itself |
Open | MessageLoaded |
Click | MessageLinkClicked |
Complaint | there is no complaint event |
The MessageId returned by the SES-compatible send appears in the event's message_id field, followed by @ and the sender's domain. See Webhooks.
SMTP¶
If you use the SES SMTP interface, change the host to smtp-out.frontengine.net and use port 587 or 465.
| Way to authenticate | Username | Password |
|---|---|---|
| Recommended | any text | the credential's key |
| SES style | the credential's identifier | the SMTP password derived from the key with the AWS algorithm, for an AWS region |
DNS¶
| Record | What to do |
|---|---|
| Verification TXT | Add FrontEngine's |
| DKIM | Add the FrontEngine key. The SES Easy DKIM CNAME records can stay until the migration ends |
| SPF | Add the FrontEngine include to the domain's SPF record |
| Return path | Publish the CNAME frp.<domain> pointing at rp.frontengine.net. It replaces the SES custom MAIL FROM subdomain |
| DMARC | No change |
The values are in Set up a sending domain.
Cutover checklist¶
- Domain verified on FrontEngine, with DKIM, SPF and return path published.
- SES client created with explicit endpoint and credentials.
- No use of templates, bulk sending or contact lists in the migrated code.
- Webhook receiver in place of the SNS consumer, with signature verification.
- Suppression list: the SES one is not imported. Remove known invalid addresses from your records.
- Traffic moved gradually, by message type.
- After the cutover: SES records removed from DNS and sending IAM keys revoked.