Back to Aws Sdk Js V3

@aws-sdk/client-sesv2

clients/client-sesv2/README.md

3.1044.058.4 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-sesv2

Description

AWS SDK for JavaScript SESv2 Client for Node.js, Browser and React Native.

<fullname>Amazon SES API v2</fullname>

<p> <a href="http://aws.amazon.com/ses">Amazon SES</a> is an Amazon Web Services service that you can use to send email messages to your customers.</p> <p>If you're new to Amazon SES API v2, you might find it helpful to review the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/">Amazon Simple Email Service Developer Guide</a>. The <i>Amazon SES Developer Guide</i> provides information and code samples that demonstrate how to use Amazon SES API v2 features programmatically.</p>

Installing

To install this package, use the CLI of your favorite package manager:

  • npm install @aws-sdk/client-sesv2
  • yarn add @aws-sdk/client-sesv2
  • pnpm add @aws-sdk/client-sesv2

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the SESv2Client and the commands you need, for example ListTenantsCommand:

js
// ES5 example
const { SESv2Client, ListTenantsCommand } = require("@aws-sdk/client-sesv2");
ts
// ES6+ example
import { SESv2Client, ListTenantsCommand } from "@aws-sdk/client-sesv2";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new SESv2Client({ region: "REGION" });

const params = { /** input parameters */ };
const command = new ListTenantsCommand(params);

Async/await

We recommend using the await operator to wait for the promise returned by send operation as follows:

js
// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Promises

You can also use Promise chaining.

js
client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

SESv2 extends SESv2Client and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (SESv2Client). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { SESv2 } from "@aws-sdk/client-sesv2";

const client = new SESv2({ region: "REGION" });

// async/await.
try {
  const data = await client.listTenants(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listTenants(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks (not recommended).
client.listTenants(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

js
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-sesv2 package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

<details> <summary> BatchGetMetricData </summary>

Command API Reference / Input / Output

</details> <details> <summary> CancelExportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateConfigurationSet </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateConfigurationSetEventDestination </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateContact </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateContactList </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateCustomVerificationEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateDedicatedIpPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateDeliverabilityTestReport </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateEmailIdentity </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateEmailIdentityPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateExportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateImportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateMultiRegionEndpoint </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateTenant </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateTenantResourceAssociation </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConfigurationSet </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConfigurationSetEventDestination </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteContact </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteContactList </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteCustomVerificationEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteDedicatedIpPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteEmailIdentity </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteEmailIdentityPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteMultiRegionEndpoint </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteSuppressedDestination </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteTenant </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteTenantResourceAssociation </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetBlacklistReports </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetConfigurationSet </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetConfigurationSetEventDestinations </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetContact </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetContactList </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetCustomVerificationEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDedicatedIp </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDedicatedIpPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDedicatedIps </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDeliverabilityDashboardOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDeliverabilityTestReport </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDomainDeliverabilityCampaign </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDomainStatisticsReport </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetEmailAddressInsights </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetEmailIdentity </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetEmailIdentityPolicies </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetExportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetImportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMessageInsights </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMultiRegionEndpoint </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetReputationEntity </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSuppressedDestination </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetTenant </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListConfigurationSets </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListContactLists </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListContacts </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListCustomVerificationEmailTemplates </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDedicatedIpPools </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDeliverabilityTestReports </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDomainDeliverabilityCampaigns </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListEmailIdentities </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListEmailTemplates </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListExportJobs </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListImportJobs </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMultiRegionEndpoints </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListRecommendations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListReputationEntities </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListResourceTenants </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSuppressedDestinations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTenantResources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTenants </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAccountDedicatedIpWarmupAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAccountDetails </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAccountSendingAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAccountSuppressionAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAccountVdmAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetArchivingOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetDeliveryOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetReputationOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetSendingOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetSuppressionOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetTrackingOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutConfigurationSetVdmOptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutDedicatedIpInPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutDedicatedIpPoolScalingAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutDedicatedIpWarmupAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutDeliverabilityDashboardOption </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEmailIdentityConfigurationSetAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEmailIdentityDkimAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEmailIdentityDkimSigningAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEmailIdentityFeedbackAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEmailIdentityMailFromAttributes </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutSuppressedDestination </summary>

Command API Reference / Input / Output

</details> <details> <summary> SendBulkEmail </summary>

Command API Reference / Input / Output

</details> <details> <summary> SendCustomVerificationEmail </summary>

Command API Reference / Input / Output

</details> <details> <summary> SendEmail </summary>

Command API Reference / Input / Output

</details> <details> <summary> TagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> TestRenderEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> UntagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateConfigurationSetEventDestination </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateContact </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateContactList </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateCustomVerificationEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateEmailIdentityPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateEmailTemplate </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateReputationEntityCustomerManagedStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateReputationEntityPolicy </summary>

Command API Reference / Input / Output

</details>