Skip to main content

AWS SES

Setting Up Email with AWS SES

Prerequisites

Before beginning this tutorial, ensure you have an AWS SES account. If you do not have an AWS SES account yet, please sign up:

Step 1: Add the AWS SES Integration to Courier

  1. Log in to Courier
  2. Navigate to the Integrations page.
  3. Select the AWS SES Integration to configure it.

Step 2: Create an AWS SES API Key

  1. Log in to AWS SES.
  2. Navigate to "Settings" → "My Security Credentials."
  3. Go to ”Access management” → “Users.”
  4. On the "Users" page, select “Add user” and follow the steps to create a new IAM user with AmazonSESFullAccess permissions.
Important

Be sure to download and save the Access Key ID and Secret Access Key upon user creation.

Creating and Configuring a Custom IAM Policy

If your use case requires specific permissions beyond the AmazonSESFullAccess policy, you may need to create a custom IAM policy:

  1. In the AWS IAM console, navigate to "Policies" and select “Create policy.”
  2. Use the JSON editor to define the policy. Here's an example of a custom policy allowing specific SES actions:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": ["ses:SendRawEmail", "ses:GetSendStatistics"],
"Resource": "*"
}
]
}
  1. After defining the policy, attach it to the IAM user created for AWS SES.

Step 3: Integrate AWS SES API Key with Courier

After creating the IAM user and obtaining the API keys, add them to the Courier AWS SES integration page.

Step 4: Add a Verified "From" Address in Courier

  1. Add a verified email address (e.g., support@example.com) to the "From Address" field in Courier.
    • The "From" email address you set will be used for all emails sent via the AWS SES integration. You can override this default "From" address on a per channel basis within your templates.
  2. Ensure the "From" address is a verified identity in your AWS-SES account.
  3. For more information on verifying identities, see Verifying an Identity for Amazon SES Sending Authorization .
AWS SES Sandbox Limitations

New AWS SES accounts start in a limited state called the "SES sandbox." In this mode, you can only send emails to verified addresses and domains. To enable email sending to non-verified addresses, you must request AWS to lift these restrictions. For guidance on this process, see Moving out of the Amazon SES sandbox .

Step 5: Configure AWS SES Region

Select your preferred AWS SES region from the dropdown menu in the Courier AWS SES integration.

Step 6: Create and Send a Courier Notification using AWS SES

Refer to Create and Send a Message for instructions on building your notification template and sending a message with the Courier API using cURL.

Profile Requirements for Message Delivery

To deliver a message via AWS SES, include the recipient's email address in the profile as shown below:

{
"message": {
// Recipient Profile
"to": {
"email": "example@example.com"
}
// ... rest of message definition
}
}

Overrides

Overrides in Courier offer the flexibility to customize settings specifically for AWS SES, adapting to more advanced email sending requirements. This is useful when you need to pass custom configurations, such as a MIME 1.0 string, instead of using the standard Courier template. While using Courier's override feature, you can modify various fields that are specific to AWS SES's SendRawEmail method.

For a comprehensive list of fields that can be overridden in the context of AWS SES, refer to the AWS documentation on the SendRawEmail API .

Using Overrides to Modify Email Settings

Here’s an example of how to implement an override in Courier to modify the RawMessage data:

{
"message": {
"template": "<COURIER_NOTIFICATION_ID>",
"to": {
"email": "kpryde@xavierinstitute.edu"
},
"data": {
"name": "Katherine Pryde"
},
"providers": {
"aws-ses": {
"override": {
"body": {
"RawMessage": {
"Data": "<Mime 1.0 compatible message>"
}
},
"config": {
"accessKeyId": "<Access Key ID>",
"secretAccessKey": "<Secret Access Key>"
}
}
}
}
}
}

Sending Attachments with Overrides

To include an attachment in your email, use the attachments override as follows:

{
"message": {
"to": {
"email": "kpryde@xavierinstitute.edu"
},
"template": "<COURIER_NOTIFICATION_ID>",
"data": {
"name": "Katherine Pryde"
},
"providers": {
"aws-ses": {
"override": {
"attachments": [
{
"filename": "hello.txt",
"contentType": "text/plain",
"data": "SGk="
}
]
}
}
}
}
}
Was this helpful?