startOutboundEmailContact method
Initiates a flow to send an agent reply or outbound email contact (created from the CreateContact API) to a customer.
May throw AccessDeniedException.
May throw IdempotencyException.
May throw InternalServiceException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
Parameter contactId :
The identifier of the contact in this instance of Connect Customer.
Parameter destinationEmailAddress :
The email address of the customer.
Parameter emailMessage :
The email message body to be sent to the newly created email.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter additionalRecipients :
The additional recipients address of email in CC.
Parameter clientToken :
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.
Parameter fromEmailAddress :
The email address associated with the Connect Customer instance.
Implementation
Future<StartOutboundEmailContactResponse> startOutboundEmailContact({
required String contactId,
required EmailAddressInfo destinationEmailAddress,
required OutboundEmailContent emailMessage,
required String instanceId,
OutboundAdditionalRecipients? additionalRecipients,
String? clientToken,
EmailAddressInfo? fromEmailAddress,
}) async {
final $payload = <String, dynamic>{
'ContactId': contactId,
'DestinationEmailAddress': destinationEmailAddress,
'EmailMessage': emailMessage,
'InstanceId': instanceId,
if (additionalRecipients != null)
'AdditionalRecipients': additionalRecipients,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (fromEmailAddress != null) 'FromEmailAddress': fromEmailAddress,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/contact/outbound-email',
exceptionFnMap: _exceptionFns,
);
return StartOutboundEmailContactResponse.fromJson(response);
}