Skip to content

How to set up an AWS S3 CDN connector

This article shows you how to set up an AWS S3 CDN connector, and how to use it when you export an email.

By default, images in your emails are served from the EmailShepherd CDN. With a CDN connector, EmailShepherd uploads your images to your own S3 bucket when you export an email, and changes the image URLs in the email to point to your CDN.

The connector only exports images from your image library. Images you’ve added by URL keep their original URL.

You need:

  • An S3 bucket to export images to.
  • A URL that serves the files in that bucket publicly, such as a CloudFront distribution (e.g. https://d1234abcd.cloudfront.net) or your own domain (e.g. https://cdn.yourbrand.com).
  • An IAM user with an access key, and these permissions on the bucket:
PermissionWhy it’s needed
s3:ListBucketEmailShepherd checks it can access the bucket when you save the connector.
s3:PutObjectEmailShepherd uploads your images to the bucket when you export.
  1. In the sidebar, click Connectors.
  2. Click CDN Connectors.
  3. Click Add CDN connector.
  4. In Connector Name, enter a name your team will recognize, e.g. “Brand image CDN”.
  5. In Choose Integration, select AWS S3.
  6. Fill in the bucket details:
    • Bucket Name: the name of your S3 bucket.
    • Prefix (optional): the folder in the bucket to save images in, e.g. images/.
    • Region: the AWS region your bucket is in.
  7. Fill in the URL details. See How image URLs are built for an example.
    • Base URL: the URL that serves files from your bucket, e.g. https://cdn.yourbrand.com.
    • URL Path Prefix (optional): the path to add after the base URL. This is usually the same as Prefix, but can be different depending on how your CDN is set up. If you’re not sure, check with your infrastructure team.
  8. Fill in your IAM user’s credentials:
    • Access Key ID
    • Secret Access Key
  9. Click Create Connector.

Setting up an AWS S3 CDN connector

When you export an email, each image URL is built from your Base URL, your URL Path Prefix and the image’s file name. For example, with these settings:

SettingValue
Base URLhttps://cdn.yourbrand.com
URL Path Prefiximages/

An image with the file name abcd-efgh-ijkl-mnop.jpg gets this URL:

https://cdn.yourbrand.com/images/abcd-efgh-ijkl-mnop.jpg

Each image keeps the same file name every time it’s exported, so an image used in several emails is only stored once in your bucket.

  1. Start an export of a published email, and choose the export type.
  2. In Image hosting, select Use a CDN Connector.
  3. In CDN Connector, select your connector.
  4. Click Start export.

Choosing a CDN connector for image hosting