Skip to content

Commit

Permalink
Workflow (Java, Python, Rust): SESv2 Weekly Mailer
Browse files Browse the repository at this point in the history
Implementation in Java, Python, and Rust, with metadata, for SESv2 Weekly Mailer workflow.
  • Loading branch information
DavidSouther committed Mar 28, 2024
1 parent 5fad395 commit 3e98c62
Show file tree
Hide file tree
Showing 23 changed files with 3,366 additions and 83 deletions.
259 changes: 255 additions & 4 deletions .doc_gen/metadata/sesv2_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ sesv2_CreateContactList:
- description:
snippet_tags:
- ses.rust.create-contact-list
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.CreateContactList
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.CreateContactList
services:
sesv2: {CreateContactList}
sesv2_CreateContact:
Expand All @@ -29,6 +45,22 @@ sesv2_CreateContact:
- description:
snippet_tags:
- ses.rust.create-contact
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.CreateContact
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.CreateContact
services:
sesv2: {CreateContact}
sesv2_GetEmailIdentity:
Expand Down Expand Up @@ -77,12 +109,28 @@ sesv2_ListContacts:
- description:
snippet_tags:
- ses.rust.list-contacts
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.ListContacts
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.ListContacts
services:
sesv2: {ListContacts}
sesv2_SendEmail:
title: Send an &SESv2; email using an &AWS; SDK
title_abbrev: Send an email
synopsis: send an &SESv2; email.
sesv2_SendEmail_Simple:
title: Send a simple &SESv2; email using an &AWS; SDK
title_abbrev: Send a simple email
synopsis: send a simple &SESv2; email.
category:
languages:
Java:
Expand Down Expand Up @@ -110,5 +158,208 @@ sesv2_SendEmail:
- description:
snippet_tags:
- ruby.example_code.ses.v2.send_email
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.SendEmail.simple
services:
sesv2: {SendEmail}
sesv2_SendEmail_Template:
title: Send a templated &SESv2; email using an &AWS; SDK
title_abbrev: Send a templated email
synopsis: send a templated &SESv2; email.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description: Sends a message.
snippet_tags:
- sesv2.java2.newsletter.SendEmail.template
Rust:
versions:
- sdk_version: 1
github: rustv1/examples/ses
excerpts:
- description: Sends a message to all members of the contact list.
snippet_tags:
- sesv2.rust.send-email.template
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.SendEmail.template
services:
sesv2: {SendEmail}
sesv2_CreateEmailIdentity:
title: Create an &SESv2; email identity using an &AWS; SDK
title_abbrev: Create an email identity
synopsis: create an &SESv2; email identity.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.CreateEmailIdentity
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.CreateEmailIdentity
Rust:
versions:
- sdk_version: 1
github: rustv1/examples/ses
excerpts:
- description:
snippet_tags:
- sesv2.rust.create-email-identity
services:
sesv2: {CreateEmailIdentity}

sesv2_CreateEmailTemplate:
title: Create an &SESv2; email template using an &AWS; SDK
title_abbrev: Create an email template
synopsis: create an &SESv2; email template.
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.CreateEmailTemplate
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.CreateEmailTemplate
Rust:
versions:
- sdk_version: 1
github: rustv1/examples/ses
excerpts:
- description:
snippet_tags:
- sesv2.rust.create-email-template
services:
sesv2: {CreateEmailTemplate}

sesv2_DeleteContactList:
title: Delete an &SESv2; contact list using an &AWS; SDK
title_abbrev: Delete a contact list
synopsis: delete an &SESv2; contact list.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.DeleteContactList
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.DeleteContactList
Rust:
versions:
- sdk_version: 1
github: rustv1/examples/ses
excerpts:
- description:
snippet_tags:
- sesv2.rust.delete-contact-list
services:
sesv2: {DeleteContactList}

sesv2_DeleteEmailIdentity:
title: Delete an &SESv2; email identity using an &AWS; SDK
title_abbrev: Delete an email identity
synopsis: delete an &SESv2; email identity.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.DeleteEmailIdentity
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.DeleteEmailIdentity
Rust:
versions:
- sdk_version: 1
github: rustv1/examples/ses
excerpts:
- description:
snippet_tags:
- sesv2.rust.delete-email-identity
services:
sesv2: {DeleteEmailIdentity}

sesv2_DeleteEmailTemplate:
title: Delete an &SESv2; email template using an &AWS; SDK
title_abbrev: Delete an email template
synopsis: delete an &SESv2; email template.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ses
excerpts:
- description:
snippet_tags:
- sesv2.java2.newsletter.DeleteEmailTemplate
Python:
versions:
- sdk_version: 3
github: python/example_code/sesv2
excerpts:
- description:
snippet_tags:
- python.example_code.sesv2.DeleteEmailTemplate
Rust:
versions:
- sdk_version: 1
github: rustv1/examples/ses
excerpts:
- description:
snippet_tags:
- sesv2.rust.delete-email-template
services:
sesv2: {DeleteEmailTemplate}
45 changes: 23 additions & 22 deletions javav2/example_code/ses/Readme.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Amazon SES code examples for the SDK for Java 2.x
# Amazon SES v2 API code examples for the SDK for Java 2.x

## Overview

Shows how to use the AWS SDK for Java 2.x to work with Amazon Simple Email Service (Amazon SES).
Shows how to use the AWS SDK for Java 2.x to work with Amazon Simple Email Service v2 API.

<!--custom.overview.start-->
<!--custom.overview.end-->

_Amazon SES is a reliable, scalable, and cost-effective email service._
_Amazon SES v2 API is a reliable, scalable, and cost-effective email service._

## ⚠ Important

* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
- Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
- Running the tests might result in charges to your AWS account.
- We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
- This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).

<!--custom.important.start-->
<!--custom.important.end-->
Expand All @@ -25,19 +25,23 @@ _Amazon SES is a reliable, scalable, and cost-effective email service._

For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav2` folder.


<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Single actions

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

- [List email templates](src/main/java/com/example/sesv2/ListTemplates.java#L6) (`ListTemplates`)
- [List identities](src/main/java/com/example/ses/ListIdentities.java#L6) (`ListIdentities`)
- [Send email](src/main/java/com/example/ses/SendMessageEmailRequest.java#L6) (`SendEmail`)
- [Send templated email](src/main/java/com/example/sesv2/SendEmailTemplate.java#L6) (`SendTemplatedEmail`)

- [Create a contact in a contact list](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L199) (`CreateContact`)
- [Create a contact list](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L113) (`CreateContactList`)
- [Create an email identity](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L91) (`CreateEmailIdentity`)
- [Create an email template](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L133) (`CreateEmailTemplate`)
- [Delete a contact list](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L325) (`DeleteContactList`)
- [Delete an email identity](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L369) (`DeleteEmailIdentity`)
- [Delete an email template](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L344) (`DeleteEmailTemplate`)
- [List the contacts in a contact list](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L252) (`ListContacts`)
- [Send a simple email](src/main/java/com/example/sesv2/SendEmail.java#L6) (`SendEmail`)
- [Send a templated email](src/main/java/com/example/sesv2/NewsletterWorkflow.java#L263) (`SendEmail`)

<!--custom.examples.start-->
<!--custom.examples.end-->
Expand All @@ -46,30 +50,27 @@ Code excerpts that show you how to call individual service functions.

### Instructions


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

To run the Newsletter example, copy the files from workflows/sesv2_weekly_mailer/resources into a new folder, javav2/example_code/ses/resources/coupon_newsletter.

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

### Tests

⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `javav2` folder.



<!--custom.tests.start-->
<!--custom.tests.end-->

## Additional resources

- [Amazon SES Developer Guide](https://docs.aws.amazon.com/ses/latest/dg/Welcome.html)
- [Amazon SES API Reference](https://docs.aws.amazon.com/ses/latest/APIReference/Welcome.html)
- [SDK for Java 2.x Amazon SES reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/ses/package-summary.html)
- [Amazon SES v2 API Developer Guide](https://docs.aws.amazon.com/ses/latest/dg/Welcome.html)
- [Amazon SES v2 API API Reference](https://docs.aws.amazon.com/ses/latest/APIReference-V2/Welcome.html)
- [SDK for Java 2.x Amazon SES v2 API reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/ses/package-summary.html)

<!--custom.resources.start-->
<!--custom.resources.end-->
Expand All @@ -78,4 +79,4 @@ in the `javav2` folder.

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
Loading

0 comments on commit 3e98c62

Please sign in to comment.