Skip to content

start_email_contact

start_email_contact(
    instance_id: InstanceId,
    from_email_address: EmailAddressInfo,
    destination_email_address: EmailAddress,
    email_message: InboundEmailContent,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[Description] = None,
    references: Optional[ContactReferences] = None,
    name: Optional[Name] = None,
    additional_recipients: Optional[InboundAdditionalRecipients] = None,
    attachments: Optional[EmailAttachments] = None,
    contact_flow_id: Optional[ContactFlowId] = None,
    related_contact_id: Optional[ContactId] = None,
    attributes: Optional[Attributes] = None,
    segment_attributes: Optional[SegmentAttributes] = None,
    client_token: Optional[ClientToken] = None,
) -> StartEmailContactResponse

Creates an inbound email contact and initiates a flow to start the email contact for the customer. Response of this API provides the ContactId of the email contact created.

Parameters:

  • instance_id (InstanceId) –

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

  • from_email_address (EmailAddressInfo) –

    The email address of the customer.

  • destination_email_address (EmailAddress) –

    The email address associated with the Connect Customer instance.

  • description (Optional[Description], default: None ) –

    A description of the email contact.

  • references (Optional[ContactReferences], default: None ) –

    A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Emails can have the following reference types at the time of creation: URL | NUMBER | STRING | DATE. EMAIL | EMAIL_MESSAGE |ATTACHMENT are not a supported reference type during email creation.

  • name (Optional[Name], default: None ) –

    The name of a email that is shown to an agent in the Contact Control Panel (CCP).

  • email_message (InboundEmailContent) –

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

  • additional_recipients (Optional[InboundAdditionalRecipients], default: None ) –

    The additional recipients address of the email.

  • attachments (Optional[EmailAttachments], default: None ) –

    List of S3 presigned URLs of email attachments and their file name.

  • contact_flow_id (Optional[ContactFlowId], default: None ) –

    The identifier of the flow for initiating the emails. To see the ContactFlowId in the Connect Customer admin website, on the navigation menu go to Routing, Flows. Choose the flow. On the flow page, under the name of the flow, choose Show additional flow information. The ContactFlowId is the last part of the ARN, shown here in bold:

    arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx

  • related_contact_id (Optional[ContactId], default: None ) –

    The contactId that is related to this contact. Linking emails together by using RelatedContactID copies over contact attributes from the related email contact to the new email contact. All updates to user-defined attributes in the new email contact are limited to the individual contact ID. There are no limits to the number of contacts that can be linked by using RelatedContactId.

  • attributes (Optional[Attributes], default: None ) –

    A custom key-value pair using an attribute map. The attributes are standard Connect Customer attributes, and can be accessed in flows just like any other contact attributes.

    There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.

  • segment_attributes (Optional[SegmentAttributes], default: None ) –

    A set of system defined key-value pairs stored on individual contact segments using an attribute map. The attributes are standard Connect Customer attributes. They can be accessed in flows.

    Attribute keys can include only alphanumeric, -, and _.

    This field can be used to show channel subtype, such as connect:Guide.

    To set contact expiry, a ValueMap must be specified containing the integer number of minutes the contact will be active for before expiring, with SegmentAttributes like { "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger":135}}}}.

  • client_token (Optional[ClientToken], default: None ) –

    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.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def start_email_contact(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    from_email_address: "capo_connect.types.email_address_info.EmailAddressInfo",
    destination_email_address: "capo_connect.types.email_address.EmailAddress",
    email_message: "capo_connect.types.inbound_email_content.InboundEmailContent",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional["capo_connect.types.description.Description"] = None,
    references: Optional[
        "capo_connect.types.contact_references.ContactReferences"
    ] = None,
    name: Optional["capo_connect.types.name.Name"] = None,
    additional_recipients: Optional[
        "capo_connect.types.inbound_additional_recipients.InboundAdditionalRecipients"
    ] = None,
    attachments: Optional[
        "capo_connect.types.email_attachments.EmailAttachments"
    ] = None,
    contact_flow_id: Optional[
        "capo_connect.types.contact_flow_id.ContactFlowId"
    ] = None,
    related_contact_id: Optional["capo_connect.types.contact_id.ContactId"] = None,
    attributes: Optional["capo_connect.types.attributes.Attributes"] = None,
    segment_attributes: Optional[
        "capo_connect.types.segment_attributes.SegmentAttributes"
    ] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> "capo_connect.types.start_email_contact_response.StartEmailContactResponse":
    """<p>Creates an inbound email contact and initiates a flow to start the email contact for the customer. Response of this API provides the ContactId of the email contact created.</p>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        from_email_address: <p>The email address of the customer.</p>
        destination_email_address: <p>The email address associated with the Connect Customer instance.</p>
        description: <p>A description of the email contact.</p>
        references: <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Emails can have the following reference types at the time of creation: <code>URL</code> | <code>NUMBER</code> | <code>STRING</code> | <code>DATE</code>. <code>EMAIL</code> | <code>EMAIL_MESSAGE</code> |<code>ATTACHMENT</code> are not a supported reference type during email creation.</p>
        name: <p>The name of a email that is shown to an agent in the Contact Control Panel (CCP).</p>
        email_message: <p>The email message body to be sent to the newly created email.</p>
        additional_recipients: <p>The additional recipients address of the email.</p>
        attachments: <p>List of S3 presigned URLs of email attachments and their file name. </p>
        contact_flow_id: <p>The identifier of the flow for initiating the emails. To see the ContactFlowId in the Connect Customer admin website, on the navigation menu go to <b>Routing</b>, <b>Flows</b>. Choose the flow. On the flow page, under the name of the flow, choose <b>Show additional flow information</b>. The ContactFlowId is the last part of the ARN, shown here in bold: </p> <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b> </p>
        related_contact_id: <p>The contactId that is related to this contact. Linking emails together by using <code>RelatedContactID</code> copies over contact attributes from the related email contact to the new email contact. All updates to user-defined attributes in the new email contact are limited to the individual contact ID. There are no limits to the number of contacts that can be linked by using <code>RelatedContactId</code>. </p>
        attributes: <p>A custom key-value pair using an attribute map. The attributes are standard Connect Customer attributes, and can be accessed in flows just like any other contact attributes.</p> <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
        segment_attributes: <p>A set of system defined key-value pairs stored on individual contact segments using an attribute map. The attributes are standard Connect Customer attributes. They can be accessed in flows.</p> <p>Attribute keys can include only alphanumeric, -, and _.</p> <p>This field can be used to show channel subtype, such as <code>connect:Guide</code>.</p> <note> <p>To set contact expiry, a <code>ValueMap</code> must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger":135}}}}</code>.</p> </note>
        client_token: <p>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 <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.idempotency_exception.IdempotencyException: <p>An entity with the same name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.start_email_contact_request.StartEmailContactRequest]",
    ) -> OperationResponse[
        "capo_connect.types.start_email_contact_response.StartEmailContactResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.start_email_contact

        output, http_response = (
            capo_connect._operations.amazon_connect_service.start_email_contact.start_email_contact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_connect.types.start_email_contact_request.StartEmailContactRequest",
    ) -> dict[str, Any]:
        import capo_connect.types.start_email_contact_request

        return capo_connect.types.start_email_contact_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartEmailContact", redact_input=_redact_input),
    )
    input_: capo_connect.types.start_email_contact_request.StartEmailContactRequest = {
        "instance_id": instance_id,
        "from_email_address": from_email_address,
        "destination_email_address": destination_email_address,
        "email_message": email_message,
    }
    if description is not None:
        input_["description"] = description
    if references is not None:
        input_["references"] = references
    if name is not None:
        input_["name"] = name
    if additional_recipients is not None:
        input_["additional_recipients"] = additional_recipients
    if attachments is not None:
        input_["attachments"] = attachments
    if contact_flow_id is not None:
        input_["contact_flow_id"] = contact_flow_id
    if related_contact_id is not None:
        input_["related_contact_id"] = related_contact_id
    if attributes is not None:
        input_["attributes"] = attributes
    if segment_attributes is not None:
        input_["segment_attributes"] = segment_attributes
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output