SendOutboundEmailCommand

Send outbound email for outbound campaigns. For more information about outbound campaigns, see Set up Amazon Connect outbound campaigns .

Only the Amazon Connect outbound campaigns service principal is allowed to assume a role in your account and call this API.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ConnectClient, SendOutboundEmailCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, SendOutboundEmailCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // SendOutboundEmailRequest
  InstanceId: "STRING_VALUE", // required
  FromEmailAddress: { // EmailAddressInfo
    EmailAddress: "STRING_VALUE", // required
    DisplayName: "STRING_VALUE",
  },
  DestinationEmailAddress: {
    EmailAddress: "STRING_VALUE", // required
    DisplayName: "STRING_VALUE",
  },
  AdditionalRecipients: { // OutboundAdditionalRecipients
    CcEmailAddresses: [ // EmailAddressRecipientList
      {
        EmailAddress: "STRING_VALUE", // required
        DisplayName: "STRING_VALUE",
      },
    ],
  },
  EmailMessage: { // OutboundEmailContent
    MessageSourceType: "TEMPLATE" || "RAW", // required
    TemplatedMessageConfig: { // TemplatedMessageConfig
      KnowledgeBaseId: "STRING_VALUE", // required
      MessageTemplateId: "STRING_VALUE", // required
      TemplateAttributes: { // TemplateAttributes
        CustomAttributes: { // Attributes
          "<keys>": "STRING_VALUE",
        },
        CustomerProfileAttributes: "STRING_VALUE",
      },
    },
    RawMessage: { // OutboundRawMessage
      Subject: "STRING_VALUE", // required
      Body: "STRING_VALUE", // required
      ContentType: "STRING_VALUE", // required
    },
  },
  TrafficType: "GENERAL" || "CAMPAIGN", // required
  SourceCampaign: { // SourceCampaign
    CampaignId: "STRING_VALUE",
    OutboundRequestId: "STRING_VALUE",
  },
  ClientToken: "STRING_VALUE",
};
const command = new SendOutboundEmailCommand(input);
const response = await client.send(command);
// {};

SendOutboundEmailCommand Input

See SendOutboundEmailCommandInput for more details

Parameter
Type
Description
DestinationEmailAddress
Required
EmailAddressInfo | undefined

The email address to send the email to.

EmailMessage
Required
OutboundEmailContent | undefined

The email message body to be sent to the newly created email.

FromEmailAddress
Required
EmailAddressInfo | undefined

The email address to be used for sending email.

InstanceId
Required
string | undefined

The identifier of the Amazon Connect instance. You can find the instance ID  in the Amazon Resource Name (ARN) of the instance.

TrafficType
Required
TrafficType | undefined

Denotes the class of traffic.

AdditionalRecipients
OutboundAdditionalRecipients | undefined

The additional recipients address of the email in CC.

ClientToken
string | undefined

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs .

SourceCampaign
SourceCampaign | undefined

A Campaign object need for Campaign traffic type.

SendOutboundEmailCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient permissions to perform this action.

IdempotencyException
client

An entity with the same name already exists.

InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidRequestException
client

The request is not valid.

ResourceNotFoundException
client

The specified resource was not found.

ServiceQuotaExceededException
client

The service quota has been exceeded.

ThrottlingException
client

The throttling limit has been exceeded.

ConnectServiceException
Base exception class for all service exceptions from Connect service.