Skip to content

Commit 36686f2

Browse files
committed
revamp ses
1 parent 4bab281 commit 36686f2

File tree

1 file changed

+55
-46
lines changed
  • src/content/docs/aws/services

1 file changed

+55
-46
lines changed

src/content/docs/aws/services/ses.md

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Simple Email Service (SES)"
3-
linkTitle: "Simple Email Service (SES)"
43
description: Get started with Amazon Simple Email Service (SES) on LocalStack
54
tags: ["Free", "Base"]
65
persistence: supported
@@ -11,12 +10,12 @@ persistence: supported
1110
Simple Email Service (SES) is an emailing service that can be integrated with other cloud-based services.
1211
It provides API to facilitate email templating, sending bulk emails and more.
1312

14-
The supported APIs are available on the API coverage page for [SESv1]({{< ref "coverage_ses" >}}) and [SESv2]({{< ref "coverage_sesv2" >}}).
13+
The supported APIs are available on the API coverage page for [SESv1](), and [SESv2]().
1514

16-
{{< callout "Note" >}}
15+
:::note
1716
Users on Free plan can use SES V1 APIs in LocalStack for basic mocking and testing.
1817
For advanced features like SMTP integration and other emulation capabilities, please refer to the Ultimate plan.
19-
{{< /callout >}}
18+
:::
2019

2120
## Getting Started
2221

@@ -30,38 +29,43 @@ A verified identity appears as part of the 'From' field in the sent email.
3029

3130
A singular email identity can be added using the `VerifyEmailIdentity` operation.
3231

33-
{{< command >}}
34-
$ awslocal ses verify-email-identity --email [email protected]
32+
```bash
33+
awslocal ses verify-email-identity --email [email protected]
3534

36-
$ awslocal ses list-identities
35+
awslocal ses list-identities
3736
{
3837
"Identities": [
3938
4039
]
4140
}
42-
{{< /command >}}
41+
```
4342

44-
{{< callout >}}
43+
:::note
4544
On AWS, verifying email identities or domain identities require additional steps like changing DNS configuration or clicking verification links respectively.
4645
In LocalStack, identities are automatically verified.
47-
{{< /callout >}}
46+
:::
4847

4948
Next, emails can be sent using the `SendEmail` operation.
5049

51-
{{< command >}}
52-
$ awslocal ses send-email \
50+
```bash
51+
awslocal ses send-email \
5352
--from "[email protected]" \
5453
--message 'Body={Text={Data="This is the email body"}},Subject={Data="This is the email subject"}' \
5554
--destination '[email protected]'
55+
```
56+
57+
The following output is displayed:
58+
59+
```bash
5660
{
5761
"MessageId": "labpqxukegeaftfh-ymaouvvy-ribr-qeoy-izfp-kxaxbfcfsgbh-wpewvd"
5862
}
59-
{{< /command >}}
63+
```
6064

61-
{{< callout >}}
65+
:::note
6266
In LocalStack Community, all operations are mocked and no real emails are sent.
6367
In LocalStack Pro, it is possible to send real emails via an SMTP server.
64-
{{< /callout >}}
68+
:::
6569

6670
## Retrieve Sent Emails
6771

@@ -70,56 +74,61 @@ Sent messages can be retrieved in following ways:
7074
- **API endpoint:** LocalStack provides a service endpoint (`/_aws/ses`) which can be used to return in-memory saved messages.
7175
A `GET` call returns all messages.
7276
Query parameters `id` and `email` can be used to filter by message ID and message source respectively.
73-
{{< command >}}
74-
$ curl --silent localhost.localstack.cloud:4566/_aws/ses?email=[email protected] | jq .
75-
{
76-
"messages": [
77+
78+
```bash
79+
curl --silent localhost.localstack.cloud:4566/_aws/ses?[email protected] | jq .
80+
```
81+
82+
The following output is displayed:
83+
84+
```bash
7785
{
78-
"Id": "dqxhhgoutkmylpbc-ffuqlkjs-ljld-fckp-hcph-wcsrkmxhhldk-pvadjc",
79-
"Region": "eu-central-1",
80-
"Destination": {
81-
"ToAddresses": [
82-
83-
]
84-
},
85-
"Source": "[email protected]",
86-
"Subject": "This is the email subject",
87-
"Body": {
88-
"text_part": "This is the email body",
89-
"html_part": null
90-
},
91-
"Timestamp": "2023-09-11T08:37:13"
86+
"messages": [
87+
{
88+
"Id": "dqxhhgoutkmylpbc-ffuqlkjs-ljld-fckp-hcph-wcsrkmxhhldk-pvadjc",
89+
"Region": "eu-central-1",
90+
"Destination": {
91+
"ToAddresses": [
92+
93+
]
94+
},
95+
"Source": "[email protected]",
96+
"Subject": "This is the email subject",
97+
"Body": {
98+
"text_part": "This is the email body",
99+
"html_part": null
100+
},
101+
"Timestamp": "2023-09-11T08:37:13"
102+
}
103+
]
92104
}
93-
]
94-
}
95-
{{< /command >}}
105+
```
96106
A `DELETE` call clears all messages from the memory.
97107
The query parameter `id` can be used to delete only a specific message.
98-
{{< command >}}
99-
$ curl -X DELETE localhost.localstack.cloud:4566/_aws/ses?id=dqxhhgoutkmylpbc-ffuqlkjs-ljld-fckp-hcph-wcsrkmxhhldk-pvadjc
100-
{{< /command >}}
101-
- **Filesystem:** All messages are saved to the state directory (see [filesystem layout]({{< ref "filesystem" >}})).
108+
109+
```bash
110+
curl -X DELETE localhost.localstack.cloud:4566/_aws/ses?id=dqxhhgoutkmylpbc-ffuqlkjs-ljld-fckp-hcph-wcsrkmxhhldk-pvadjc
111+
```
112+
- **Filesystem:** All messages are saved to the state directory (see [filesystem layout](/aws/capabilities/config/filesystem)).
102113
The files are saved as JSON in the `ses/` subdirectory and named by the message ID.
103114

104115
## SMTP Integration
105116

106117
LocalStack Pro supports sending emails via an SMTP server.
107118
To enable this, set the connections parameters and access credentials for the server in the configuration.
108-
Refer to the [Configuration]({{< ref "configuration#emails" >}}) guide for details.
119+
Refer to the [Configuration](/aws/capabilities/config/configuration/#emails) guide for details.
109120

110-
{{< callout "tip" >}}
121+
:::note
111122
If you do not have access to a live SMTP server, you can use tools like [MailDev](https://github.com/maildev/maildev) or [smtp4dev](https://github.com/rnwood/smtp4dev).
112123
These run as Docker containers on your local machine.
113124
Make sure they run in the same Docker network as the LocalStack container.
114-
{{< /callout >}}
125+
:::
115126

116127
## Resource Browser
117128

118129
LocalStack Web Application provides a resource browser for managing email identities and introspecing sent emails.
119130

120-
<img src="ses-resource-browser.png" alt="SES Resource Browser" title="SESE Resource Browser" width="900"/>
121-
<br/>
122-
<br/>
131+
![SES Resource Browser](/images/aws/ses-resource-browser.png)
123132

124133
The Resource Browser allows you to perform following actions:
125134
- **Create Email Identity**: Create an email identity by clicking **Create Identity** and specifying the email address.

0 commit comments

Comments
 (0)