Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .doc_gen/metadata/sesv2_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ sesv2_CreateContact:
sesv2: {CreateContact}
sesv2_GetEmailIdentity:
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.GetEmailIdentity
Rust:
versions:
- sdk_version: 1
Expand Down Expand Up @@ -248,6 +257,10 @@ sesv2_SendEmail:
- python.example_code.sesv2.SESv2Workflow.main
- python.example_code.sesv2.SESv2Workflow.decl
- python.example_code.sesv2.SendEmail.template
- description: Sends a message with optional attachments.
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.SendEmail
services:
sesv2: {SendEmail}
sesv2_CreateEmailIdentity:
Expand Down Expand Up @@ -290,6 +303,10 @@ sesv2_CreateEmailIdentity:
- python.example_code.sesv2.SESv2Workflow.main
- python.example_code.sesv2.SESv2Workflow.decl
- python.example_code.sesv2.CreateEmailIdentity
- description:
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.CreateEmailIdentity
Rust:
versions:
- sdk_version: 1
Expand Down Expand Up @@ -341,6 +358,10 @@ sesv2_CreateEmailTemplate:
- python.example_code.sesv2.SESv2Workflow.main
- python.example_code.sesv2.SESv2Workflow.decl
- python.example_code.sesv2.CreateEmailTemplate
- description:
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.CreateEmailTemplate
Rust:
versions:
- sdk_version: 1
Expand Down Expand Up @@ -443,6 +464,10 @@ sesv2_DeleteEmailIdentity:
- python.example_code.sesv2.SESv2Workflow.main
- python.example_code.sesv2.SESv2Workflow.decl
- python.example_code.sesv2.DeleteEmailIdentity
- description:
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.DeleteEmailIdentity
Rust:
versions:
- sdk_version: 1
Expand Down Expand Up @@ -494,6 +519,10 @@ sesv2_DeleteEmailTemplate:
- python.example_code.sesv2.SESv2Workflow.main
- python.example_code.sesv2.SESv2Workflow.decl
- python.example_code.sesv2.DeleteEmailTemplate
- description:
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.DeleteEmailTemplate
Rust:
versions:
- sdk_version: 1
Expand Down Expand Up @@ -581,3 +610,63 @@ sesv2_NewsletterWorkflow:
services:
sesv2: {CreateContactList, CreateContact, ListContacts, SendEmail.simple, SendEmail.template, CreateEmailIdentity, CreateEmailTemplate,
DeleteContactList, DeleteEmailIdentity, DeleteEmailTemplate}

sesv2_Hello:
title: Hello &SESv2;
title_abbrev: Hello &SESv2;
synopsis: get started using &SESv2;.
category: Hello
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.Hello
services:
sesv2: {ListEmailIdentities}
sesv2_SendBulkEmail:
title: Send bulk email with &SESv2;
title_abbrev: Send bulk email
synopsis: send bulk email with &SESv2;.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.decl
- python.example_code.sesv2.SendBulkEmail
services:
sesv2: {SendBulkEmail}
sesv2_Scenario_EmailAttachments:
title: Send emails with attachments using &SESv2;
title_abbrev: Email Attachments Scenario
synopsis: send emails with attachments using &SESv2;.
synopsis_list:
- Verify sender email identity.
- Create an email template for bulk sends.
- Send a simple email with a file attachment.
- Send a simple email with an inline image.
- Send bulk templated emails with attachments.
- Clean up resources.
category: Scenarios
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description: Create an SESv2 wrapper class to manage operations.
snippet_tags:
- python.example_code.sesv2.SESv2Wrapper.class
- description: Run an interactive scenario demonstrating email attachments.
snippet_tags:
- python.example_code.sesv2.Scenario_EmailAttachments
services:
sesv2: {SendEmail, SendBulkEmail, CreateEmailIdentity, CreateEmailTemplate, GetEmailIdentity, DeleteEmailTemplate, DeleteEmailIdentity}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ kotlin/services/**/.kotlin/
.kiro/settings/
.kiro/steering/

/codeloom_outputs
4 changes: 2 additions & 2 deletions .tools/base_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
black==26.3.1
black==24.10.0
flake8==6.1.0
mypy-extensions==1.0.0
pathspec==1.0.0
pathspec==0.11.2
PyYAML==6.0.1
requests==2.33.0
typer==0.15.2
Expand Down
2 changes: 1 addition & 1 deletion .tools/readmes/requirements_freeze.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aws_doc_sdk_examples_tools @ git+https://github.com/awsdocs/aws-doc-sdk-examples-tools@2025.41.0
black==26.3.1
black==24.10.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
Expand Down
51 changes: 47 additions & 4 deletions python/example_code/sesv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,23 @@ python -m pip install -r requirements.txt
<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Get started

- [Hello Amazon SES v2 API](sesv2_hello.py#L18) (`ListEmailIdentities`)


### Single actions

Code excerpts that show you how to call individual service functions.

- [CreateContact](newsletter.py#L155)
- [CreateContactList](newsletter.py#L105)
- [CreateEmailIdentity](newsletter.py#L92)
- [CreateEmailTemplate](newsletter.py#L118)
- [CreateEmailIdentity](sesv2_wrapper.py#L73)
- [CreateEmailTemplate](sesv2_wrapper.py#L109)
- [DeleteContactList](newsletter.py#L258)
- [DeleteEmailIdentity](newsletter.py#L286)
- [DeleteEmailTemplate](newsletter.py#L271)
- [DeleteEmailIdentity](sesv2_wrapper.py#L321)
- [DeleteEmailTemplate](sesv2_wrapper.py#L291)
- [GetEmailIdentity](sesv2_wrapper.py#L42)
- [ListContacts](newsletter.py#L198)
- [SendEmail](newsletter.py#L164)

Expand All @@ -53,8 +59,14 @@ Code excerpts that show you how to call individual service functions.
Code examples that show you how to accomplish a specific task by calling multiple
functions within the same service.

- [Email Attachments Scenario](sesv2_wrapper.py)
- [Newsletter scenario](newsletter.py)

### Actions
_Actions_ are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

- [SendBulkEmail](sesv2_wrapper.py#L227)


<!--custom.examples.start-->
<!--custom.examples.end-->
Expand All @@ -74,7 +86,38 @@ To run the Newsletter example, copy the files from workflows/sesv2_weekly_mailer

<!--custom.instructions.end-->

#### Hello Amazon SES v2 API

This example shows you how to get started using Amazon SES v2 API.

```
python sesv2_hello.py
```


#### Email Attachments Scenario

This example shows you how to send emails with attachments using Amazon SES v2 API.

- Verify sender email identity.
- Create an email template for bulk sends.
- Send a simple email with a file attachment.
- Send a simple email with an inline image.
- Send bulk templated emails with attachments.
- Clean up resources.

<!--custom.scenario_prereqs.sesv2_Scenario_EmailAttachments.start-->
<!--custom.scenario_prereqs.sesv2_Scenario_EmailAttachments.end-->

Start the example by running the following at a command prompt:

```
python sesv2_wrapper.py
```


<!--custom.scenarios.sesv2_Scenario_EmailAttachments.start-->
<!--custom.scenarios.sesv2_Scenario_EmailAttachments.end-->

#### Newsletter scenario

Expand Down
3 changes: 2 additions & 1 deletion python/example_code/sesv2/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
boto3>=1.26.79
boto3>=1.35.0
botocore>=1.35.0
pytest>=7.2.1
Loading
Loading