SESExemplos da Amazon usando SDK for JavaScript (v3) - AWS SDK for JavaScript

O Guia de API referência da AWS SDK for JavaScript V3 descreve detalhadamente todas as API operações da AWS SDK for JavaScript versão 3 (V3).

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

SESExemplos da Amazon usando SDK for JavaScript (v3)

Os exemplos de código a seguir mostram como realizar ações e implementar cenários comuns usando o AWS SDK for JavaScript (v3) com a AmazonSES.

Ações são trechos de código de programas maiores e devem ser executadas em contexto. Embora as ações mostrem como chamar funções de serviço específicas, é possível ver as ações contextualizadas em seus devidos cenários e exemplos entre serviços.

Cenários são exemplos de código que mostram como realizar uma tarefa específica chamando várias funções dentro do mesmo serviço.

Cada exemplo inclui um link para GitHub, onde você pode encontrar instruções sobre como configurar e executar o código no contexto.

Tópicos

Ações

O código de exemplo a seguir mostra como usar CreateReceiptFilter.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { CreateReceiptFilterCommand, ReceiptFilterPolicy, } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; const createCreateReceiptFilterCommand = ({ policy, ipOrRange, name }) => { return new CreateReceiptFilterCommand({ Filter: { IpFilter: { Cidr: ipOrRange, // string, either a single IP address (10.0.0.1) or an IP address range in CIDR notation (10.0.0.1/24)). Policy: policy, // enum ReceiptFilterPolicy, email traffic from the filtered addressesOptions. }, /* The name of the IP address filter. Only ASCII letters, numbers, underscores, or dashes. Must be less than 64 characters and start and end with a letter or number. */ Name: name, }, }); }; const FILTER_NAME = getUniqueName("ReceiptFilter"); const run = async () => { const createReceiptFilterCommand = createCreateReceiptFilterCommand({ policy: ReceiptFilterPolicy.Allow, ipOrRange: "10.0.0.1", name: FILTER_NAME, }); try { return await sesClient.send(createReceiptFilterCommand); } catch (caught) { if (caught instanceof Error && caught.name === "MessageRejected") { /** @type { import('@aws-sdk/client-ses').MessageRejected} */ const messageRejectedError = caught; return messageRejectedError; } throw caught; } };
  • Para API obter detalhes, consulte CreateReceiptFilterem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar CreateReceiptRule.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { CreateReceiptRuleCommand, TlsPolicy } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; const RULE_SET_NAME = getUniqueName("RuleSetName"); const RULE_NAME = getUniqueName("RuleName"); const S3_BUCKET_NAME = getUniqueName("S3BucketName"); const createS3ReceiptRuleCommand = ({ bucketName, emailAddresses, name, ruleSet, }) => { return new CreateReceiptRuleCommand({ Rule: { Actions: [ { S3Action: { BucketName: bucketName, ObjectKeyPrefix: "email", }, }, ], Recipients: emailAddresses, Enabled: true, Name: name, ScanEnabled: false, TlsPolicy: TlsPolicy.Optional, }, RuleSetName: ruleSet, // Required }); }; const run = async () => { const s3ReceiptRuleCommand = createS3ReceiptRuleCommand({ bucketName: S3_BUCKET_NAME, emailAddresses: ["email@example.com"], name: RULE_NAME, ruleSet: RULE_SET_NAME, }); try { return await sesClient.send(s3ReceiptRuleCommand); } catch (err) { console.log("Failed to create S3 receipt rule.", err); throw err; } };
  • Para API obter detalhes, consulte CreateReceiptRuleem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar CreateReceiptRuleSet.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { CreateReceiptRuleSetCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; const RULE_SET_NAME = getUniqueName("RuleSetName"); const createCreateReceiptRuleSetCommand = (ruleSetName) => { return new CreateReceiptRuleSetCommand({ RuleSetName: ruleSetName }); }; const run = async () => { const createReceiptRuleSetCommand = createCreateReceiptRuleSetCommand(RULE_SET_NAME); try { return await sesClient.send(createReceiptRuleSetCommand); } catch (err) { console.log("Failed to create receipt rule set", err); return err; } };

O código de exemplo a seguir mostra como usar CreateTemplate.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { CreateTemplateCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; const TEMPLATE_NAME = getUniqueName("TestTemplateName"); const createCreateTemplateCommand = () => { return new CreateTemplateCommand({ /** * The template feature in Amazon SES is based on the Handlebars template system. */ Template: { /** * The name of an existing template in Amazon SES. */ TemplateName: TEMPLATE_NAME, HtmlPart: ` <h1>Hello, {{contact.firstName}}!</h1> <p> Did you know Amazon has a mascot named Peccy? </p> `, SubjectPart: "Amazon Tip", }, }); }; const run = async () => { const createTemplateCommand = createCreateTemplateCommand(); try { return await sesClient.send(createTemplateCommand); } catch (err) { console.log("Failed to create template.", err); return err; } };
  • Para API obter detalhes, consulte CreateTemplateem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar DeleteIdentity.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { DeleteIdentityCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; const IDENTITY_EMAIL = "fake@example.com"; const createDeleteIdentityCommand = (identityName) => { return new DeleteIdentityCommand({ Identity: identityName, }); }; const run = async () => { const deleteIdentityCommand = createDeleteIdentityCommand(IDENTITY_EMAIL); try { return await sesClient.send(deleteIdentityCommand); } catch (err) { console.log("Failed to delete identity.", err); return err; } };
  • Para API obter detalhes, consulte DeleteIdentityem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar DeleteReceiptFilter.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { DeleteReceiptFilterCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; const RECEIPT_FILTER_NAME = getUniqueName("ReceiptFilterName"); const createDeleteReceiptFilterCommand = (filterName) => { return new DeleteReceiptFilterCommand({ FilterName: filterName }); }; const run = async () => { const deleteReceiptFilterCommand = createDeleteReceiptFilterCommand(RECEIPT_FILTER_NAME); try { return await sesClient.send(deleteReceiptFilterCommand); } catch (err) { console.log("Error deleting receipt filter.", err); return err; } };
  • Para API obter detalhes, consulte DeleteReceiptFilterem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar DeleteReceiptRule.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { DeleteReceiptRuleCommand } from "@aws-sdk/client-ses"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; const RULE_NAME = getUniqueName("RuleName"); const RULE_SET_NAME = getUniqueName("RuleSetName"); const createDeleteReceiptRuleCommand = () => { return new DeleteReceiptRuleCommand({ RuleName: RULE_NAME, RuleSetName: RULE_SET_NAME, }); }; const run = async () => { const deleteReceiptRuleCommand = createDeleteReceiptRuleCommand(); try { return await sesClient.send(deleteReceiptRuleCommand); } catch (err) { console.log("Failed to delete receipt rule.", err); return err; } };
  • Para API obter detalhes, consulte DeleteReceiptRuleem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar DeleteReceiptRuleSet.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { DeleteReceiptRuleSetCommand } from "@aws-sdk/client-ses"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; const RULE_SET_NAME = getUniqueName("RuleSetName"); const createDeleteReceiptRuleSetCommand = () => { return new DeleteReceiptRuleSetCommand({ RuleSetName: RULE_SET_NAME }); }; const run = async () => { const deleteReceiptRuleSetCommand = createDeleteReceiptRuleSetCommand(); try { return await sesClient.send(deleteReceiptRuleSetCommand); } catch (err) { console.log("Failed to delete receipt rule set.", err); return err; } };

O código de exemplo a seguir mostra como usar DeleteTemplate.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { DeleteTemplateCommand } from "@aws-sdk/client-ses"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; const TEMPLATE_NAME = getUniqueName("TemplateName"); const createDeleteTemplateCommand = (templateName) => new DeleteTemplateCommand({ TemplateName: templateName }); const run = async () => { const deleteTemplateCommand = createDeleteTemplateCommand(TEMPLATE_NAME); try { return await sesClient.send(deleteTemplateCommand); } catch (err) { console.log("Failed to delete template.", err); return err; } };
  • Para API obter detalhes, consulte DeleteTemplateem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar GetTemplate.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { GetTemplateCommand } from "@aws-sdk/client-ses"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; const TEMPLATE_NAME = getUniqueName("TemplateName"); const createGetTemplateCommand = (templateName) => new GetTemplateCommand({ TemplateName: templateName }); const run = async () => { const getTemplateCommand = createGetTemplateCommand(TEMPLATE_NAME); try { return await sesClient.send(getTemplateCommand); } catch (caught) { if (caught instanceof Error && caught.name === "MessageRejected") { /** @type { import('@aws-sdk/client-ses').MessageRejected} */ const messageRejectedError = caught; return messageRejectedError; } throw caught; } };
  • Para API obter detalhes, consulte GetTemplateem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar ListIdentities.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { ListIdentitiesCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; const createListIdentitiesCommand = () => new ListIdentitiesCommand({ IdentityType: "EmailAddress", MaxItems: 10 }); const run = async () => { const listIdentitiesCommand = createListIdentitiesCommand(); try { return await sesClient.send(listIdentitiesCommand); } catch (err) { console.log("Failed to list identities.", err); return err; } };
  • Para API obter detalhes, consulte ListIdentitiesem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar ListReceiptFilters.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { ListReceiptFiltersCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; const createListReceiptFiltersCommand = () => new ListReceiptFiltersCommand({}); const run = async () => { const listReceiptFiltersCommand = createListReceiptFiltersCommand(); return await sesClient.send(listReceiptFiltersCommand); };
  • Para API obter detalhes, consulte ListReceiptFiltersem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar ListTemplates.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { ListTemplatesCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; const createListTemplatesCommand = (maxItems) => new ListTemplatesCommand({ MaxItems: maxItems }); const run = async () => { const listTemplatesCommand = createListTemplatesCommand(10); try { return await sesClient.send(listTemplatesCommand); } catch (err) { console.log("Failed to list templates.", err); return err; } };
  • Para API obter detalhes, consulte ListTemplatesem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar SendBulkTemplatedEmail.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { SendBulkTemplatedEmailCommand } from "@aws-sdk/client-ses"; import { getUniqueName, postfix, } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; /** * Replace this with the name of an existing template. */ const TEMPLATE_NAME = getUniqueName("ReminderTemplate"); /** * Replace these with existing verified emails. */ const VERIFIED_EMAIL_1 = postfix(getUniqueName("Bilbo"), "@example.com"); const VERIFIED_EMAIL_2 = postfix(getUniqueName("Frodo"), "@example.com"); const USERS = [ { firstName: "Bilbo", emailAddress: VERIFIED_EMAIL_1 }, { firstName: "Frodo", emailAddress: VERIFIED_EMAIL_2 }, ]; /** * * @param { { emailAddress: string, firstName: string }[] } users * @param { string } templateName the name of an existing template in SES * @returns { SendBulkTemplatedEmailCommand } */ const createBulkReminderEmailCommand = (users, templateName) => { return new SendBulkTemplatedEmailCommand({ /** * Each 'Destination' uses a corresponding set of replacement data. We can map each user * to a 'Destination' and provide user specific replacement data to create personalized emails. * * Here's an example of how a template would be replaced with user data: * Template: <h1>Hello {{name}},</h1><p>Don't forget about the party gifts!</p> * Destination 1: <h1>Hello Bilbo,</h1><p>Don't forget about the party gifts!</p> * Destination 2: <h1>Hello Frodo,</h1><p>Don't forget about the party gifts!</p> */ Destinations: users.map((user) => ({ Destination: { ToAddresses: [user.emailAddress] }, ReplacementTemplateData: JSON.stringify({ name: user.firstName }), })), DefaultTemplateData: JSON.stringify({ name: "Shireling" }), Source: VERIFIED_EMAIL_1, Template: templateName, }); }; const run = async () => { const sendBulkTemplateEmailCommand = createBulkReminderEmailCommand( USERS, TEMPLATE_NAME, ); try { return await sesClient.send(sendBulkTemplateEmailCommand); } catch (caught) { if (caught instanceof Error && caught.name === "MessageRejected") { /** @type { import('@aws-sdk/client-ses').MessageRejected} */ const messageRejectedError = caught; return messageRejectedError; } throw caught; } };

O código de exemplo a seguir mostra como usar SendEmail.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { SendEmailCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; const createSendEmailCommand = (toAddress, fromAddress) => { return new SendEmailCommand({ Destination: { /* required */ CcAddresses: [ /* more items */ ], ToAddresses: [ toAddress, /* more To-email addresses */ ], }, Message: { /* required */ Body: { /* required */ Html: { Charset: "UTF-8", Data: "HTML_FORMAT_BODY", }, Text: { Charset: "UTF-8", Data: "TEXT_FORMAT_BODY", }, }, Subject: { Charset: "UTF-8", Data: "EMAIL_SUBJECT", }, }, Source: fromAddress, ReplyToAddresses: [ /* more items */ ], }); }; const run = async () => { const sendEmailCommand = createSendEmailCommand( "recipient@example.com", "sender@example.com", ); try { return await sesClient.send(sendEmailCommand); } catch (caught) { if (caught instanceof Error && caught.name === "MessageRejected") { /** @type { import('@aws-sdk/client-ses').MessageRejected} */ const messageRejectedError = caught; return messageRejectedError; } throw caught; } };
  • Para API obter detalhes, consulte SendEmailem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar SendRawEmail.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

Use nodemailer para enviar um e-mail com anexo.

import sesClientModule from "@aws-sdk/client-ses"; /** * nodemailer wraps the SES SDK and calls SendRawEmail. Use this for more advanced * functionality like adding attachments to your email. * * https://nodemailer.com/transports/ses/ */ import nodemailer from "nodemailer"; /** * @param {string} from An Amazon SES verified email address. * @param {*} to An Amazon SES verified email address. */ export const sendEmailWithAttachments = ( from = "from@example.com", to = "to@example.com", ) => { const ses = new sesClientModule.SESClient({}); const transporter = nodemailer.createTransport({ SES: { ses, aws: sesClientModule }, }); return new Promise((resolve, reject) => { transporter.sendMail( { from, to, subject: "Hello World", text: "Greetings from Amazon SES!", attachments: [{ content: "Hello World!", filename: "hello.txt" }], }, (err, info) => { if (err) { reject(err); } else { resolve(info); } }, ); }); };
  • Para API obter detalhes, consulte SendRawEmailem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar SendTemplatedEmail.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { SendTemplatedEmailCommand } from "@aws-sdk/client-ses"; import { getUniqueName, postfix, } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; /** * Replace this with the name of an existing template. */ const TEMPLATE_NAME = getUniqueName("ReminderTemplate"); /** * Replace these with existing verified emails. */ const VERIFIED_EMAIL = postfix(getUniqueName("Bilbo"), "@example.com"); const USER = { firstName: "Bilbo", emailAddress: VERIFIED_EMAIL }; /** * * @param { { emailAddress: string, firstName: string } } user * @param { string } templateName - The name of an existing template in Amazon SES. * @returns { SendTemplatedEmailCommand } */ const createReminderEmailCommand = (user, templateName) => { return new SendTemplatedEmailCommand({ /** * Here's an example of how a template would be replaced with user data: * Template: <h1>Hello {{contact.firstName}},</h1><p>Don't forget about the party gifts!</p> * Destination: <h1>Hello Bilbo,</h1><p>Don't forget about the party gifts!</p> */ Destination: { ToAddresses: [user.emailAddress] }, TemplateData: JSON.stringify({ contact: { firstName: user.firstName } }), Source: VERIFIED_EMAIL, Template: templateName, }); }; const run = async () => { const sendReminderEmailCommand = createReminderEmailCommand( USER, TEMPLATE_NAME, ); try { return await sesClient.send(sendReminderEmailCommand); } catch (caught) { if (caught instanceof Error && caught.name === "MessageRejected") { /** @type { import('@aws-sdk/client-ses').MessageRejected} */ const messageRejectedError = caught; return messageRejectedError; } throw caught; } };
  • Para API obter detalhes, consulte SendTemplatedEmailem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar UpdateTemplate.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { UpdateTemplateCommand } from "@aws-sdk/client-ses"; import { getUniqueName } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; const TEMPLATE_NAME = getUniqueName("TemplateName"); const HTML_PART = "<h1>Hello, World!</h1>"; const createUpdateTemplateCommand = () => { return new UpdateTemplateCommand({ Template: { TemplateName: TEMPLATE_NAME, HtmlPart: HTML_PART, SubjectPart: "Example", TextPart: "Updated template text.", }, }); }; const run = async () => { const updateTemplateCommand = createUpdateTemplateCommand(); try { return await sesClient.send(updateTemplateCommand); } catch (err) { console.log("Failed to update template.", err); return err; } };
  • Para API obter detalhes, consulte UpdateTemplateem AWS SDK for JavaScript APIReferência.

O código de exemplo a seguir mostra como usar VerifyDomainIdentity.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

import { VerifyDomainIdentityCommand } from "@aws-sdk/client-ses"; import { getUniqueName, postfix, } from "@aws-doc-sdk-examples/lib/utils/util-string.js"; import { sesClient } from "./libs/sesClient.js"; /** * You must have access to the domain's DNS settings to complete the * domain verification process. */ const DOMAIN_NAME = postfix(getUniqueName("Domain"), ".example.com"); const createVerifyDomainIdentityCommand = () => { return new VerifyDomainIdentityCommand({ Domain: DOMAIN_NAME }); }; const run = async () => { const VerifyDomainIdentityCommand = createVerifyDomainIdentityCommand(); try { return await sesClient.send(VerifyDomainIdentityCommand); } catch (err) { console.log("Failed to verify domain.", err); return err; } };

O código de exemplo a seguir mostra como usar VerifyEmailIdentity.

SDKpara JavaScript (v3)
nota

Tem mais sobre GitHub. Encontre o exemplo completo e veja como configurar e executar no AWS Code Examples Repository.

// Import required AWS SDK clients and commands for Node.js import { VerifyEmailIdentityCommand } from "@aws-sdk/client-ses"; import { sesClient } from "./libs/sesClient.js"; const EMAIL_ADDRESS = "name@example.com"; const createVerifyEmailIdentityCommand = (emailAddress) => { return new VerifyEmailIdentityCommand({ EmailAddress: emailAddress }); }; const run = async () => { const verifyEmailIdentityCommand = createVerifyEmailIdentityCommand(EMAIL_ADDRESS); try { return await sesClient.send(verifyEmailIdentityCommand); } catch (err) { console.log("Failed to verify email identity.", err); return err; } };
  • Para API obter detalhes, consulte VerifyEmailIdentityem AWS SDK for JavaScript APIReferência.