Webhook endpoint

AWS pushes SES events to this URL. Sesmograph never needs your AWS credentials.

https://demo.sesmograph.com/webhooks/xhz5engfv7rmtnknb31h2wwl16jigsdrfqqulbnatn4qmamc

Connect AWS

Five steps in the AWS console, in the region you send from - or expand Prefer CLI? under each step. In the CLI commands, replace <region> and <account-id> with your values.

  1. 1. Create a configuration set

    A configuration set tracks what happens after emails are sent.

    1. Go to Amazon SES (correct region)
    2. Navigate to Configuration sets
    3. Click Create set
    4. Name: demo-billing-ses
    5. Leave defaults, click Create set
    Prefer CLI?
    aws ses create-configuration-set \
      --configuration-set '{"Name":"demo-billing-ses"}' \
      --region <region>
  2. 2. Create an SNS topic

    SNS forwards events to your webhook.

    1. Go to Amazon SNS
    2. Click Topics -> Create topic
    3. Select Standard (not FIFO)
    4. Name: demo-billing-ses-events
    5. Click Create topic
    Prefer CLI?
    aws sns create-topic \
      --name "demo-billing-ses-events" \
      --region <region>
  3. 3. Subscribe this webhook

    An HTTPS subscription pointing at this topic's endpoint.

    1. From the SNS topic, click Create subscription
    2. Protocol: HTTPS
    3. Endpoint: https://demo.sesmograph.com/webhooks/xhz5engfv7rmtnknb31h2wwl16jigsdrfqqulbnatn4qmamc
    4. Leave filter policy empty
    5. Leave "Enable raw message delivery" unchecked
    6. Click Create subscription
    7. Confirmation is automatic
    Prefer CLI?
    aws sns subscribe \
      --topic-arn arn:aws:sns:<region>:<account-id>:demo-billing-ses-events \
      --protocol https \
      --notification-endpoint "https://demo.sesmograph.com/webhooks/xhz5engfv7rmtnknb31h2wwl16jigsdrfqqulbnatn4qmamc" \
      --region <region>
  4. 4. Add an event destination

    Connect the configuration set to the SNS topic.

    1. Go to SES -> Configuration sets
    2. Click demo-billing-ses
    3. Event destinations tab -> Add destination
    4. Select all event types: Sends, Deliveries, Bounces, Complaints, Opens, Clicks, Delivery delays, Rejections, Rendering failures, Subscriptions
    5. Destination type: Amazon SNS
    6. Topic: demo-billing-ses-events
    7. Enable "Include original email headers" - that is how subjects and recipients show up here
    8. Click Add destination
    Prefer CLI?
    aws ses create-configuration-set-event-destination \
      --configuration-set-name "demo-billing-ses" \
      --event-destination '{
        "Name":"demo-billing-ses-events",
        "Enabled":true,
        "MatchingEventTypes":["send","reject","bounce","complaint","delivery","open","click","renderingFailure","deliveryDelay","subscription"],
        "SNSDestination":{"TopicARN":"arn:aws:sns:<region>:<account-id>:demo-billing-ses-events"}
      }' \
      --region <region>
  5. 5. Send with the configuration set

    Specify the configuration set on outgoing mail - as an API parameter or a header:

    X-SES-CONFIGURATION-SET: demo-billing-ses

    Or skip the header: set it as the identity's default, and SES applies it to every email sent from that address or domain.

    1. Go to SES -> Identities
    2. Open the identity you send from
    3. Configuration set tab -> Edit
    4. Pick demo-billing-ses as the default configuration set, save
    Prefer CLI?
    aws sesv2 put-email-identity-configuration-set-attributes \
      --email-identity your-identity.example.com \
      --configuration-set-name "demo-billing-ses" \
      --region <region>

Optional: store full message content

SES events never carry the body. To see full messages here, have your app post the content right after sending, using the SES message id and an API token (Settings -> API tokens). Bodies are kept for 30 days.

curl -X POST https://demo.sesmograph.com/api/v1/messages/<ses-message-id>/content \
  -H "Authorization: Bearer <api-token>" \
  -H "Content-Type: application/json" \
  -d '{"html":"<!doctype html>...","text":"Plain-text version"}'

Verify it works

Send a test email through the configuration set. Its events appear on this topic within seconds.

Prefer CLI?
aws sns list-subscriptions-by-topic \
  --topic-arn arn:aws:sns:<region>:<account-id>:demo-billing-ses-events \
  --region <region>

aws ses describe-configuration-set \
  --configuration-set-name "demo-billing-ses" \
  --configuration-set-attribute-names eventDestinations \
  --region <region>
Demo with sample data · read-only · resets every 2 hours Get your own →