# Connect Amazon SES API

{% hint style="danger" %}
**We are not following Amazon's best practices in this guide to greatly reduce complexity.**

This documentation gives you the shortest path to send your first email by having you create access keys for the root user. This will increase your chances of a successful setup.
{% endhint %}

{% hint style="warning" %}
Amazon recommends creating an IAM account that has the minimum access required for using SES as best practice, rather than using root user access keys as shown in this guide.&#x20;
{% endhint %}

{% hint style="info" %}
**Advanced users only**

To implement Amazon's best practices yourself, create a new user with only the [AmazonSESFullAccess](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/control-user-access.html) and [AmazonSNSFullAccess](https://docs.aws.amazon.com/sns/latest/dg/AccessPolicyLanguage.html) permissions policies applied.
{% endhint %}

First, create an Amazon AWS account if you don't have one.

As of the time of this writing, the link is:

{% embed url="<https://portal.aws.amazon.com/billing/signup#/start/email>" %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FQwMwK5pnznnkXsUrjjpj%2Fimage.png?alt=media&#x26;token=a3f3d63a-616d-4e1c-9bc1-95340f658ee9" alt=""><figcaption></figcaption></figure>

Login to the AWS console as the root user you've created&#x20;

{% embed url="<https://console.aws.amazon.com/>" %}

![](https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F8feB4FBxCEH0cCvtJM8P%2FScreenshot%202023-08-20%20at%209.29.01%20PM.png?alt=media\&token=f9105e7f-06bc-4059-8e2c-e5c2c87e3502)

You'll start off at the console home page.&#x20;

Take note of your account region, this will be needed later.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2Flx7SoDH2ctltkrnqsqjB%2FScreenshot%202023-08-20%20at%209.30.05%20PM.png?alt=media&#x26;token=d1b4a54a-e961-469c-8f0d-35d8b1114350" alt=""><figcaption></figcaption></figure>

In the upper right of the console home, click your username, then security credentials.

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FzR4avuNoxjeDoEGEXC7b%2FScreenshot%202023-08-20%20at%209.43.25%20PM.png?alt=media&#x26;token=d112bca1-7bba-4e94-a021-9694b29ab4ac" alt="" width="375"><figcaption></figcaption></figure></div>

Scroll down to create access key.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FFk8bTwnCITnjG5W6vafw%2FScreenshot%202023-08-20%20at%209.45.01%20PM.png?alt=media&#x26;token=13181864-3ee4-4841-ad16-b3d9baa91056" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Amazon will warn you this is not following best practices, confirm to go to the next step.
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F36tCSvek2uuEe1HjbhUj%2FScreenshot%202023-08-20%20at%209.45.34%20PM.png?alt=media&#x26;token=921d90ef-1c6e-465f-96aa-7522e44acf2d" alt=""><figcaption></figcaption></figure>

Copy both of your access keys and save them somewhere secure as you will need them to integrate with your EmailDelivery.com platform installation later.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FmpW2OXz1viDj5FKw3tJ6%2FScreenshot%202023-08-20%20at%209.45.47%20PM.png?alt=media&#x26;token=d3c310df-dc1b-43d5-b8f6-87398f29a329" alt=""><figcaption></figcaption></figure>

Now that your access credentials have been created, it's time to go to the Amazon SES page.&#x20;

{% embed url="<https://console.aws.amazon.com/ses/>" %}

Click verified identities.

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FEdhWdWQkPuN0Gm22Ys7J%2FScreenshot%202023-08-20%20at%2011.20.45%20PM.png?alt=media&#x26;token=609a1f49-2283-4280-a8f7-f4e24610a2dd" alt="" width="272"><figcaption></figcaption></figure></div>

Click create identity.&#x20;

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FJH4G6SbUDCw9ST0Hv7c2%2FScreenshot%202023-08-20%20at%2011.21.28%20PM.png?alt=media&#x26;token=12c1ec43-d466-41b7-a50b-9159a6d6441c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Your verified identity is the domain you want to send mail with over Amazon SES**

This is going to be a subdomain exclusively created for this purpose.
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FmIS2mQ3NPZymH0Fxx7xN%2FScreenshot%202023-08-20%20at%2011.24.14%20PM.png?alt=media&#x26;token=64f935b0-8182-430b-b1b6-19c4ff666ea3" alt=""><figcaption></figcaption></figure>

After saving, you'll need to verify your ownership of the domain by creating some CNAME records generated by Amazon to your DNS provider.&#x20;

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FH5R0OkEnmDqEtDtrCSp0%2FScreenshot%202023-08-20%20at%2011.26.40%20PM.png?alt=media&#x26;token=95eef7e9-bf37-4ede-b1ce-3942165d3c82" alt=""><figcaption></figcaption></figure>

Below is an example of how this would look on Cloudflare.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2Fkj3cvG97FKl0hdFygskU%2FScreenshot%202023-08-20%20at%2011.28.40%20PM.png?alt=media&#x26;token=a041ca99-8412-4580-a6fb-b3c893cebb53" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**The best things come to those who wait**

Amazon autodetects the CNAME records. You'll need to periodically refresh the page until it finds them.&#x20;
{% endhint %}

Once your domain has successfully been verified you'll see the following.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F6ed4EDjRMMrCK1scQm2b%2FScreenshot%202023-08-20%20at%2011.31.48%20PM.png?alt=media&#x26;token=2047c226-3992-4abf-8464-3cad18fdd838" alt=""><figcaption></figcaption></figure>

Now it's time to add your Amazon SES sending domain to your platform.

In the backend navigation go to Connect -> Amazon SES API.

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FVw9wyxE5cFGqXQ5cEGe5%2FScreenshot%202023-08-20%20at%2010.05.03%20PM.png?alt=media&#x26;token=96ac3ae6-de00-4525-90ca-8380875b96a1" alt="" width="375"><figcaption></figcaption></figure></div>

Click Add SES account.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FgdJZkhuWEomZ34WllEwt%2FScreenshot%202023-08-20%20at%2010.05.41%20PM.png?alt=media&#x26;token=7f03c9ab-d2a4-4469-b666-65083a50502d" alt=""><figcaption></figcaption></figure>

Look at the URL of your Amazon console to find your region, and add the domain you used for your verified identity.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FtXRHBrSAAfBgIa6usnGs%2FScreenshot%202023-08-20%20at%2011.34.44%20PM.png?alt=media&#x26;token=4ffd67f8-f3a4-4089-b282-7d34132ba501" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FpihPx0zUqwslbpeF1gAy%2FScreenshot%202023-08-20%20at%2011.35.48%20PM.png?alt=media&#x26;token=79a73c76-d5dc-4f3a-ac63-c953e0c99d36" alt=""><figcaption></figcaption></figure>

Click save.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FdAEbqOlAncFMq2tHhla3%2FScreenshot%202023-08-21%20at%205.10.48%20PM.png?alt=media&#x26;token=553b8685-ffeb-436f-9d43-dfde113a8d02" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**if your configuration saves successfully you should now be integrated with Amazon SES.**&#x20;
{% endhint %}

🚨  **For new Amazon SES accounts there's one more step.** 🚨

{% hint style="danger" %}
**New accounts start off in the Amazon "Sandbox" until they're approved by Amazon.**

When you're in the Amazon sandbox, you can only send test messages to your own verified email addresses; this would typically be a Gmail address.&#x20;
{% endhint %}

{% hint style="info" %}
**To verify an email address, Amazon emails a link.**&#x20;

Click the link and you can send test messages through Amazon until you're approved to send outside of the sandbox.&#x20;
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FFS1WYyp9lpNsNGQWuQAB%2FScreenshot%202023-10-25%20at%205.02.20%E2%80%AFPM.png?alt=media&#x26;token=1d2a45fd-989b-4cac-84d8-216e00e23473" alt=""><figcaption></figcaption></figure>

Create an identity just like you did to verify your domain:

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F7nzk0pMFKPeAFeZreHZ5%2FScreenshot%202023-10-25%20at%204.52.29%E2%80%AFPM.png?alt=media&#x26;token=3a72be62-a7ea-430e-83a8-7bc9e1994e32" alt=""><figcaption></figcaption></figure>

Choose Email address instead of Domain this time:

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FkCwiE96XA3h8ToMc3T43%2FScreenshot%202023-10-25%20at%203.53.09%E2%80%AFPM.png?alt=media&#x26;token=283a93ad-6f57-424c-9b0b-910f0930ede3" alt=""><figcaption></figcaption></figure>

Click the link sent to your email:

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FQooJFAo9Nra8Msnxoxq8%2FScreenshot%202023-10-25%20at%203.57.49%E2%80%AFPM.png?alt=media&#x26;token=cdd3648a-2806-4b3c-a381-5891de8f32af" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FdkVpFGdLkIasSWU7zKbo%2FScreenshot%202023-10-25%20at%203.58.09%E2%80%AFPM.png?alt=media&#x26;token=2793cb44-395f-434f-9851-51b2b7972d72" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
You're done. You can send messages to your verified email address from the sandbox now.&#x20;
{% endhint %}

{% hint style="danger" %}
**URGENT:** **Don't use an Amazon SES authenticated email address as your ESP platform's Sender Email Address.**
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FQaCuIrUzmMGtZ4u4Ga1S%2FScreenshot%202023-10-25%20at%204.00.07%E2%80%AFPM.png?alt=media&#x26;token=3366fc3f-3b8a-4c1c-9190-653638e2fabe" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Using your verified email address as your sender email address will stop Amazon from sending webhooks back to your platform, causing your stats to be blank.**&#x20;
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FKwj2kiJBCIA5kA3ORg5h%2FScreenshot%202023-10-29%20at%204.02.50%E2%80%AFPM.png?alt=media&#x26;token=9d55f9bb-5c6b-4abd-8649-0aa15c35f497" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FU3lTGgvM4KNsnmEvAzco%2FScreenshot%202023-10-29%20at%204.10.41%E2%80%AFPM.png?alt=media&#x26;token=e77277d5-d4b0-4f45-9bb6-d0d9f2aa2e20" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Troubleshooting**

The below steps are optional and for troubleshooting purposes only.
{% endhint %}

On Amazon, the notifications tab should show feedback notifications have been created. If it's not there, refresh the page a few times.&#x20;

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FqJq43icawRnV0ujO706R%2FScreenshot%202023-08-20%20at%2011.40.10%20PM.png?alt=media&#x26;token=bf102aca-2dab-458f-a22d-e0dc7b139c2d" alt=""><figcaption></figcaption></figure>

You should have an SNS topic automatically configured at the following url.

{% embed url="<https://console.aws.amazon.com/sns/>" %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F8LjhAHfPwlEJWmSP6Wej%2FScreenshot%202023-08-20%20at%2011.46.35%20PM.png?alt=media&#x26;token=4a9576be-69d3-48ad-8bb9-4f0f2b6a5336" alt=""><figcaption></figcaption></figure>

Under topics/subscriptions you should see your platform install domain admin\_url has been added automatically as your webhook endpoint.

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FiwVVT947ErME4WdQjUSi%2FScreenshot%202023-08-20%20at%2011.47.15%20PM.png?alt=media&#x26;token=9ef27405-dfdb-4c5b-8e16-3cf947c0b494" alt=""><figcaption></figcaption></figure>
