From 2f50238c6317d7f4acbaa9b3502edcdf46c52a89 Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 31 Oct 2024 18:23:40 +0000 Subject: [PATCH] feat(client-sesv2): This release enables customers to provide the email template content in the SESv2 SendEmail and SendBulkEmail APIs instead of the name or the ARN of a stored email template. --- clients/client-sesv2/README.md | 2 +- .../CreateDeliverabilityTestReportCommand.ts | 5 ++ .../src/commands/SendBulkEmailCommand.ts | 5 ++ .../src/commands/SendEmailCommand.ts | 5 ++ clients/client-sesv2/src/models/models_0.ts | 67 +++++++++++-------- codegen/sdk-codegen/aws-models/sesv2.json | 8 ++- 6 files changed, 63 insertions(+), 29 deletions(-) diff --git a/clients/client-sesv2/README.md b/clients/client-sesv2/README.md index 12b28e6ee064..f2bcc6712e03 100644 --- a/clients/client-sesv2/README.md +++ b/clients/client-sesv2/README.md @@ -17,7 +17,7 @@ and code samples that demonstrate how to use Amazon SES API v2 features programm ## Installing -To install the this package, simply type add or install @aws-sdk/client-sesv2 +To install this package, simply type add or install @aws-sdk/client-sesv2 using your favorite package manager: - `npm install @aws-sdk/client-sesv2` diff --git a/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts b/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts index 17bba44f204e..5846b76f9e9c 100644 --- a/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts +++ b/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts @@ -78,6 +78,11 @@ export interface CreateDeliverabilityTestReportCommandOutput * Template: { // Template * TemplateName: "STRING_VALUE", * TemplateArn: "STRING_VALUE", + * TemplateContent: { // EmailTemplateContent + * Subject: "STRING_VALUE", + * Text: "STRING_VALUE", + * Html: "STRING_VALUE", + * }, * TemplateData: "STRING_VALUE", * Headers: [ * { diff --git a/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts b/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts index 9c445f3101fa..ab923e0ee6a9 100644 --- a/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts +++ b/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts @@ -53,6 +53,11 @@ export interface SendBulkEmailCommandOutput extends SendBulkEmailResponse, __Met * Template: { // Template * TemplateName: "STRING_VALUE", * TemplateArn: "STRING_VALUE", + * TemplateContent: { // EmailTemplateContent + * Subject: "STRING_VALUE", + * Text: "STRING_VALUE", + * Html: "STRING_VALUE", + * }, * TemplateData: "STRING_VALUE", * Headers: [ // MessageHeaderList * { // MessageHeader diff --git a/clients/client-sesv2/src/commands/SendEmailCommand.ts b/clients/client-sesv2/src/commands/SendEmailCommand.ts index 99aee4d3aca8..29495864f89e 100644 --- a/clients/client-sesv2/src/commands/SendEmailCommand.ts +++ b/clients/client-sesv2/src/commands/SendEmailCommand.ts @@ -106,6 +106,11 @@ export interface SendEmailCommandOutput extends SendEmailResponse, __MetadataBea * Template: { // Template * TemplateName: "STRING_VALUE", * TemplateArn: "STRING_VALUE", + * TemplateContent: { // EmailTemplateContent + * Subject: "STRING_VALUE", + * Text: "STRING_VALUE", + * Html: "STRING_VALUE", + * }, * TemplateData: "STRING_VALUE", * Headers: [ * { diff --git a/clients/client-sesv2/src/models/models_0.ts b/clients/client-sesv2/src/models/models_0.ts index cf0562413fdb..9c9b61dcc842 100644 --- a/clients/client-sesv2/src/models/models_0.ts +++ b/clients/client-sesv2/src/models/models_0.ts @@ -693,11 +693,39 @@ export interface MessageHeader { Value: string | undefined; } +/** + *

The content of the email, composed of a subject line, an HTML part, and a text-only + * part.

+ * @public + */ +export interface EmailTemplateContent { + /** + *

The subject line of the email.

+ * @public + */ + Subject?: string; + + /** + *

The email body that will be visible to recipients whose email clients do not display + * HTML.

+ * @public + */ + Text?: string; + + /** + *

The HTML body of the email.

+ * @public + */ + Html?: string; +} + /** *

An object that defines the email template to use for an email message, and the values * to use for any message variables in that template. An email * template is a type of message template that contains content that you - * want to define, save, and reuse in email messages that you send.

+ * want to reuse in email messages that you send. You can specifiy the email template by providing + * the name or ARN of an email template + * previously saved in your Amazon SES account or by providing the full template content.

* @public */ export interface Template { @@ -715,6 +743,17 @@ export interface Template { */ TemplateArn?: string; + /** + *

The content of the template.

+ * + *

Amazon SES supports only simple substitions when you send email using the + * SendEmail or SendBulkEmail operations and + * you provide the full template content in the request.

+ *
+ * @public + */ + TemplateContent?: EmailTemplateContent; + /** *

An object that defines the values to use for message variables in the template. This * object is a set of key-value pairs. Each key defines a message variable in the template. @@ -2670,32 +2709,6 @@ export interface CreateEmailIdentityPolicyRequest { */ export interface CreateEmailIdentityPolicyResponse {} -/** - *

The content of the email, composed of a subject line, an HTML part, and a text-only - * part.

- * @public - */ -export interface EmailTemplateContent { - /** - *

The subject line of the email.

- * @public - */ - Subject?: string; - - /** - *

The email body that will be visible to recipients whose email clients do not display - * HTML.

- * @public - */ - Text?: string; - - /** - *

The HTML body of the email.

- * @public - */ - Html?: string; -} - /** *

Represents a request to create an email template. For more information, see the Amazon SES * Developer Guide.

diff --git a/codegen/sdk-codegen/aws-models/sesv2.json b/codegen/sdk-codegen/aws-models/sesv2.json index 0c5143cd6b8f..a3ecbfa0341e 100644 --- a/codegen/sdk-codegen/aws-models/sesv2.json +++ b/codegen/sdk-codegen/aws-models/sesv2.json @@ -11768,6 +11768,12 @@ "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the template.

" } }, + "TemplateContent": { + "target": "com.amazonaws.sesv2#EmailTemplateContent", + "traits": { + "smithy.api#documentation": "

The content of the template.

\n \n

Amazon SES supports only simple substitions when you send email using the \n SendEmail or SendBulkEmail operations and \n you provide the full template content in the request.

\n
" + } + }, "TemplateData": { "target": "com.amazonaws.sesv2#EmailTemplateData", "traits": { @@ -11782,7 +11788,7 @@ } }, "traits": { - "smithy.api#documentation": "

An object that defines the email template to use for an email message, and the values\n to use for any message variables in that template. An email\n template is a type of message template that contains content that you\n want to define, save, and reuse in email messages that you send.

" + "smithy.api#documentation": "

An object that defines the email template to use for an email message, and the values\n to use for any message variables in that template. An email\n template is a type of message template that contains content that you\n want to reuse in email messages that you send. You can specifiy the email template by providing \n the name or ARN of an email template \n previously saved in your Amazon SES account or by providing the full template content.

" } }, "com.amazonaws.sesv2#TemplateContent": {