Skip to content

Commit

Permalink
feat(client-sesv2): Adds support for providing custom headers within …
Browse files Browse the repository at this point in the history
…SendEmail and SendBulkEmail for SESv2.
  • Loading branch information
awstools committed Mar 5, 2024
1 parent 45ea346 commit 4b858e0
Show file tree
Hide file tree
Showing 9 changed files with 226 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export interface CreateDeliverabilityTestReportCommandOutput
* Charset: "STRING_VALUE",
* },
* },
* Headers: [ // MessageHeaderList
* { // MessageHeader
* Name: "STRING_VALUE", // required
* Value: "STRING_VALUE", // required
* },
* ],
* },
* Raw: { // RawMessage
* Data: "BLOB_VALUE", // required
Expand All @@ -73,6 +79,12 @@ export interface CreateDeliverabilityTestReportCommandOutput
* TemplateName: "STRING_VALUE",
* TemplateArn: "STRING_VALUE",
* TemplateData: "STRING_VALUE",
* Headers: [
* {
* Name: "STRING_VALUE", // required
* Value: "STRING_VALUE", // required
* },
* ],
* },
* },
* Tags: [ // TagList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import {
PutEmailIdentityFeedbackAttributesRequest,
PutEmailIdentityFeedbackAttributesResponse,
} from "../models/models_0";
import { PutEmailIdentityFeedbackAttributesRequest } from "../models/models_0";
import { PutEmailIdentityFeedbackAttributesResponse } from "../models/models_1";
import {
de_PutEmailIdentityFeedbackAttributesCommand,
se_PutEmailIdentityFeedbackAttributesCommand,
Expand Down
6 changes: 6 additions & 0 deletions clients/client-sesv2/src/commands/SendBulkEmailCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export interface SendBulkEmailCommandOutput extends SendBulkEmailResponse, __Met
* TemplateName: "STRING_VALUE",
* TemplateArn: "STRING_VALUE",
* TemplateData: "STRING_VALUE",
* Headers: [ // MessageHeaderList
* { // MessageHeader
* Name: "STRING_VALUE", // required
* Value: "STRING_VALUE", // required
* },
* ],
* },
* },
* BulkEmailEntries: [ // BulkEmailEntryList // required
Expand Down
12 changes: 12 additions & 0 deletions clients/client-sesv2/src/commands/SendEmailCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export interface SendEmailCommandOutput extends SendEmailResponse, __MetadataBea
* Charset: "STRING_VALUE",
* },
* },
* Headers: [ // MessageHeaderList
* { // MessageHeader
* Name: "STRING_VALUE", // required
* Value: "STRING_VALUE", // required
* },
* ],
* },
* Raw: { // RawMessage
* Data: "BLOB_VALUE", // required
Expand All @@ -101,6 +107,12 @@ export interface SendEmailCommandOutput extends SendEmailResponse, __MetadataBea
* TemplateName: "STRING_VALUE",
* TemplateArn: "STRING_VALUE",
* TemplateData: "STRING_VALUE",
* Headers: [
* {
* Name: "STRING_VALUE", // required
* Value: "STRING_VALUE", // required
* },
* ],
* },
* },
* EmailTags: [ // MessageTagList
Expand Down
9 changes: 6 additions & 3 deletions clients/client-sesv2/src/commands/UpdateContactCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ export interface UpdateContactCommandOutput extends UpdateContactResponse, __Met

/**
* @public
* <p>Updates a contact's preferences for a list. It is not necessary to specify all
* existing topic preferences in the TopicPreferences object, just the ones that need
* updating.</p>
* <p>Updates a contact's preferences for a list.</p>
* <note>
* <p>You must specify all existing topic preferences in the
* <code>TopicPreferences</code> object, not just the ones that need updating;
* otherwise, all your existing preferences will be removed.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
111 changes: 80 additions & 31 deletions clients/client-sesv2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,42 @@ export interface Bounce {
DiagnosticCode?: string;
}

/**
* @public
* <p>Contains the name and value of a message header that you add to an email.</p>
*/
export interface MessageHeader {
/**
* @public
* <p>The name of the message header. The message header name has to meet the following
* criteria:</p>
* <ul>
* <li>
* <p>Can contain any printable ASCII character (33 - 126) except for colon (:).</p>
* </li>
* <li>
* <p>Can contain no more than 126 characters.</p>
* </li>
* </ul>
*/
Name: string | undefined;

/**
* @public
* <p>The value of the message header. The message header value has to meet the following
* criteria:</p>
* <ul>
* <li>
* <p>Can contain any printable ASCII character.</p>
* </li>
* <li>
* <p>Can contain no more than 870 characters.</p>
* </li>
* </ul>
*/
Value: string | undefined;
}

/**
* @public
* <p>An object that defines the email template to use for an email message, and the values
Expand Down Expand Up @@ -684,6 +720,12 @@ export interface Template {
* The corresponding value defines the value to use for that variable.</p>
*/
TemplateData?: string;

/**
* @public
* <p>The list of message headers that will be added to the email message.</p>
*/
Headers?: MessageHeader[];
}

/**
Expand Down Expand Up @@ -1231,8 +1273,8 @@ export interface ContactListDestination {

/**
* @public
* <p>>The type of action to perform on the addresses. The following are the
* possible values:</p>
* <p>>The type of action to perform on the addresses. The following are the possible
* values:</p>
* <ul>
* <li>
* <p>PUT: add the addresses to the contact list. If the record already exists, it
Expand Down Expand Up @@ -1999,8 +2041,8 @@ export interface RawMessage {
* <p>Attachments must be in a file format that the Amazon SES supports.</p>
* </li>
* <li>
* <p>The raw data of the message needs to base64-encoded if you are accessing
* Amazon SES directly through the HTTPS interface. If you are accessing Amazon SES using an Amazon Web Services
* <p>The raw data of the message needs to base64-encoded if you are accessing Amazon SES
* directly through the HTTPS interface. If you are accessing Amazon SES using an Amazon Web Services
* SDK, the SDK takes care of the base 64-encoding for you.</p>
* </li>
* <li>
Expand Down Expand Up @@ -2037,6 +2079,12 @@ export interface Message {
* version of the message, or both.</p>
*/
Body: Body | undefined;

/**
* @public
* <p>The list of message headers that will be added to the email message.</p>
*/
Headers?: MessageHeader[];
}

/**
Expand Down Expand Up @@ -2074,8 +2122,8 @@ export interface EmailContent {
* </p>
* </li>
* <li>
* <p>The raw data of the message needs to base64-encoded if you are accessing
* Amazon SES directly through the HTTPS interface. If you are accessing Amazon SES using an Amazon Web Services
* <p>The raw data of the message needs to base64-encoded if you are accessing Amazon SES
* directly through the HTTPS interface. If you are accessing Amazon SES using an Amazon Web Services
* SDK, the SDK takes care of the base 64-encoding for you.</p>
* </li>
* <li>
Expand Down Expand Up @@ -3206,20 +3254,24 @@ export interface DailyVolume {

/**
* @public
* <p>An object containing additional settings for your VDM configuration as applicable to the Dashboard.</p>
* <p>An object containing additional settings for your VDM configuration as applicable to
* the Dashboard.</p>
*/
export interface DashboardAttributes {
/**
* @public
* <p>Specifies the status of your VDM engagement metrics collection. Can be one of the following:</p>
* <p>Specifies the status of your VDM engagement metrics collection. Can be one of the
* following:</p>
* <ul>
* <li>
* <p>
* <code>ENABLED</code> – Amazon SES enables engagement metrics for your account.</p>
* <code>ENABLED</code> – Amazon SES enables engagement metrics for your
* account.</p>
* </li>
* <li>
* <p>
* <code>DISABLED</code> – Amazon SES disables engagement metrics for your account.</p>
* <code>DISABLED</code> – Amazon SES disables engagement metrics for your
* account.</p>
* </li>
* </ul>
*/
Expand Down Expand Up @@ -4177,20 +4229,24 @@ export interface SuppressionAttributes {

/**
* @public
* <p>An object containing additional settings for your VDM configuration as applicable to the Guardian.</p>
* <p>An object containing additional settings for your VDM configuration as applicable to
* the Guardian.</p>
*/
export interface GuardianAttributes {
/**
* @public
* <p>Specifies the status of your VDM optimized shared delivery. Can be one of the following:</p>
* <p>Specifies the status of your VDM optimized shared delivery. Can be one of the
* following:</p>
* <ul>
* <li>
* <p>
* <code>ENABLED</code> – Amazon SES enables optimized shared delivery for your account.</p>
* <code>ENABLED</code> – Amazon SES enables optimized shared delivery for your
* account.</p>
* </li>
* <li>
* <p>
* <code>DISABLED</code> – Amazon SES disables optimized shared delivery for your account.</p>
* <code>DISABLED</code> – Amazon SES disables optimized shared delivery for
* your account.</p>
* </li>
* </ul>
*/
Expand Down Expand Up @@ -4220,13 +4276,15 @@ export interface VdmAttributes {

/**
* @public
* <p>Specifies additional settings for your VDM configuration as applicable to the Dashboard.</p>
* <p>Specifies additional settings for your VDM configuration as applicable to the
* Dashboard.</p>
*/
DashboardAttributes?: DashboardAttributes;

/**
* @public
* <p>Specifies additional settings for your VDM configuration as applicable to the Guardian.</p>
* <p>Specifies additional settings for your VDM configuration as applicable to the
* Guardian.</p>
*/
GuardianAttributes?: GuardianAttributes;
}
Expand Down Expand Up @@ -4277,9 +4335,8 @@ export interface GetAccountResponse {
* Region.</p>
* <p>If the value is <code>false</code>, then your account is in the
* <i>sandbox</i>. When your account is in the sandbox, you can only send
* email to verified identities. Additionally, the maximum number of emails you can send in
* a 24-hour period (your sending quota) is 200, and the maximum number of emails you can
* send per second (your maximum sending rate) is 1.</p>
* email to verified identities.
* </p>
* <p>If the value is <code>true</code>, then your account has production access. When your
* account has production access, you can send email to any address. The sending quota and
* maximum sending rate for your account vary based on your specific use case.</p>
Expand Down Expand Up @@ -5952,8 +6009,8 @@ export interface ListContactsRequest {
/**
* @public
* <p>The number of contacts that may be returned at once, which is dependent on if there
* are more or less contacts than the value of the PageSize. Use this parameter to
* paginate results. If additional contacts exist beyond the specified limit, the
* are more or less contacts than the value of the PageSize. Use this parameter to paginate
* results. If additional contacts exist beyond the specified limit, the
* <code>NextToken</code> element is sent in the response. Use the
* <code>NextToken</code> value in subsequent requests to retrieve additional
* contacts.</p>
Expand Down Expand Up @@ -6764,9 +6821,8 @@ export interface PutAccountDetailsRequest {
* Amazon Web Services Region.</p>
* <p>If the value is <code>false</code>, then your account is in the
* <i>sandbox</i>. When your account is in the sandbox, you can only send
* email to verified identities. Additionally, the maximum number of emails you can send in
* a 24-hour period (your sending quota) is 200, and the maximum number of emails you can
* send per second (your maximum sending rate) is 1.</p>
* email to verified identities.
* </p>
* <p>If the value is <code>true</code>, then your account has production access. When your
* account has production access, you can send email to any address. The sending quota and
* maximum sending rate for your account vary based on your specific use case.</p>
Expand Down Expand Up @@ -7337,13 +7393,6 @@ export interface PutEmailIdentityFeedbackAttributesRequest {
EmailForwardingEnabled?: boolean;
}

/**
* @public
* <p>An HTTP 200 response if the request succeeds, or an error message if the request
* fails.</p>
*/
export interface PutEmailIdentityFeedbackAttributesResponse {}

/**
* @internal
*/
Expand Down
27 changes: 17 additions & 10 deletions clients/client-sesv2/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ import {
TopicPreference,
} from "./models_0";

/**
* @public
* <p>An HTTP 200 response if the request succeeds, or an error message if the request
* fails.</p>
*/
export interface PutEmailIdentityFeedbackAttributesResponse {}

/**
* @public
* <p>A request to configure the custom MAIL FROM domain for a verified identity.</p>
Expand Down Expand Up @@ -104,8 +111,8 @@ export interface PutSuppressedDestinationResponse {}
export interface SendBulkEmailRequest {
/**
* @public
* <p>The email address to use as the "From" address for the email. The
* address that you specify has to be verified.</p>
* <p>The email address to use as the "From" address for the email. The address that you
* specify has to be verified.</p>
*/
FromEmailAddress?: string;

Expand Down Expand Up @@ -244,8 +251,8 @@ export interface SendCustomVerificationEmailResponse {
export interface SendEmailRequest {
/**
* @public
* <p>The email address to use as the "From" address for the email. The
* address that you specify has to be verified.
* <p>The email address to use as the "From" address for the email. The address that you
* specify has to be verified.
* </p>
*/
FromEmailAddress?: string;
Expand Down Expand Up @@ -307,8 +314,8 @@ export interface SendEmailRequest {

/**
* @public
* <p>An object that contains the body of the message. You can send either a Simple message
* Raw message or a template Message.</p>
* <p>An object that contains the body of the message. You can send either a Simple message,
* Raw message, or a Templated message.</p>
*/
Content: EmailContent | undefined;

Expand Down Expand Up @@ -344,10 +351,10 @@ export interface SendEmailResponse {
* <p>A unique identifier for the message that is generated when the message is
* accepted.</p>
* <note>
* <p>It's possible for Amazon SES to accept a message without sending it. This can happen
* when the message that you're trying to send has an attachment contains a virus, or
* when you send a templated email that contains invalid personalization content, for
* example.</p>
* <p>It's possible for Amazon SES to accept a message without sending it. For example, this
* can happen when the message that you're trying to send has an attachment that
* contains a virus, or when you send a templated email that contains invalid
* personalization content.</p>
* </note>
*/
MessageId?: string;
Expand Down
Loading

0 comments on commit 4b858e0

Please sign in to comment.