:doc:`Connect <../../connect>` / Client / send_outbound_email

*******************
send_outbound_email
*******************



.. py:method:: Connect.Client.send_outbound_email(**kwargs)

  

  Send outbound email for outbound campaigns. For more information about outbound campaigns, see `Set up Amazon Connect outbound campaigns <https://docs.aws.amazon.com/connect/latest/adminguide/enable-outbound-campaigns.html>`__.

   

  .. note::

    

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

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/SendOutboundEmail>`_  


  **Request Syntax**
  ::

    response = client.send_outbound_email(
        InstanceId='string',
        FromEmailAddress={
            'EmailAddress': 'string',
            'DisplayName': 'string'
        },
        DestinationEmailAddress={
            'EmailAddress': 'string',
            'DisplayName': 'string'
        },
        AdditionalRecipients={
            'CcEmailAddresses': [
                {
                    'EmailAddress': 'string',
                    'DisplayName': 'string'
                },
            ]
        },
        EmailMessage={
            'MessageSourceType': 'TEMPLATE'|'RAW',
            'TemplatedMessageConfig': {
                'KnowledgeBaseId': 'string',
                'MessageTemplateId': 'string',
                'TemplateAttributes': {
                    'CustomAttributes': {
                        'string': 'string'
                    },
                    'CustomerProfileAttributes': 'string'
                }
            },
            'RawMessage': {
                'Subject': 'string',
                'Body': 'string',
                'ContentType': 'string'
            }
        },
        TrafficType='GENERAL'|'CAMPAIGN',
        SourceCampaign={
            'CampaignId': 'string',
            'OutboundRequestId': 'string'
        },
        ClientToken='string'
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The identifier of the Amazon Connect instance. You can `find the instance ID <https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html>`__ in the Amazon Resource Name (ARN) of the instance.

    

  
  :type FromEmailAddress: dict
  :param FromEmailAddress: **[REQUIRED]** 

    The email address to be used for sending email.

    

  
    - **EmailAddress** *(string) --* **[REQUIRED]** 

      The email address, including the domain.

      

    
    - **DisplayName** *(string) --* 

      The display name of email address.

      

    
  
  :type DestinationEmailAddress: dict
  :param DestinationEmailAddress: **[REQUIRED]** 

    The email address to send the email to.

    

  
    - **EmailAddress** *(string) --* **[REQUIRED]** 

      The email address, including the domain.

      

    
    - **DisplayName** *(string) --* 

      The display name of email address.

      

    
  
  :type AdditionalRecipients: dict
  :param AdditionalRecipients: 

    The additional recipients address of the email in CC.

    

  
    - **CcEmailAddresses** *(list) --* 

      Information about the **additional** CC email address recipients. Email recipients are limited to 50 total addresses: 1 required recipient in the `DestinationEmailAddress <https://docs.aws.amazon.com/connect/latest/APIReference/API_SendOutboundEmail.html#API_SendOutboundEmail_RequestBody>`__ field and up to 49 recipients in the 'CcEmailAddresses' field.

      

    
      - *(dict) --* 

        Contains information about a source or destination email address.

        

      
        - **EmailAddress** *(string) --* **[REQUIRED]** 

          The email address, including the domain.

          

        
        - **DisplayName** *(string) --* 

          The display name of email address.

          

        
      
  
  
  :type EmailMessage: dict
  :param EmailMessage: **[REQUIRED]** 

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

    

  
    - **MessageSourceType** *(string) --* **[REQUIRED]** 

      The message source type, that is, ``RAW`` or ``TEMPLATE``.

      

    
    - **TemplatedMessageConfig** *(dict) --* 

      Information about template message configuration.

      

    
      - **KnowledgeBaseId** *(string) --* **[REQUIRED]** 

        The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

        

      
      - **MessageTemplateId** *(string) --* **[REQUIRED]** 

        The identifier of the message template Id.

        

      
      - **TemplateAttributes** *(dict) --* **[REQUIRED]** 

        Information about template attributes, that is, CustomAttributes or CustomerProfileAttributes.

        

      
        - **CustomAttributes** *(dict) --* 

          An object that specifies the custom attributes values to use for variables in the message template. This object contains different categories of key-value pairs. Each key defines a variable or placeholder in the message template.

          

        
          - *(string) --* 

          
            - *(string) --* 

            
      
    
        - **CustomerProfileAttributes** *(string) --* 

          An object that specifies the customer profile attributes values to use for variables in the message template. This object contains different categories of key-value pairs. Each key defines a variable or placeholder in the message template.

          

        
      
    
    - **RawMessage** *(dict) --* 

      The raw email body content.

      

    
      - **Subject** *(string) --* **[REQUIRED]** 

        The email subject.

        

      
      - **Body** *(string) --* **[REQUIRED]** 

        The email message body.

        

      
      - **ContentType** *(string) --* **[REQUIRED]** 

        Type of content, that is, ``text/plain`` or ``text/html``.

        

      
    
  
  :type TrafficType: string
  :param TrafficType: **[REQUIRED]** 

    Denotes the class of traffic.

     

    .. note::

      

      Only the CAMPAIGN traffic type is supported.

      

    

  
  :type SourceCampaign: dict
  :param SourceCampaign: 

    A Campaign object need for Campaign traffic type.

    

  
    - **CampaignId** *(string) --* 

      A unique identifier for a campaign.

      

    
    - **OutboundRequestId** *(string) --* 

      A unique identifier for a each request part of same campaign.

      

    
  
  :type ClientToken: string
  :param 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 <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/>`__.

    This field is autopopulated if not provided.

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`Connect.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Connect.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`Connect.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Connect.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Connect.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Connect.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Connect.Client.exceptions.IdempotencyException`

  