Skip to content

set_identity_headers_in_notifications_enabled

set_identity_headers_in_notifications_enabled(
    identity: Identity,
    notification_type: NotificationType,
    enabled: Enabled,
    *,
    config_overrides: Optional[SESClientConfig] = None,
) -> SetIdentityHeadersInNotificationsEnabledResponse

Given an identity (an email address or a domain), sets whether Amazon SES includes the original email headers in the Amazon Simple Notification Service (Amazon SNS) notifications of a specified type.

You can execute this operation no more than once per second.

For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide.

Parameters:

  • identity (Identity) –

    The identity for which to enable or disable headers in notifications. Examples: [email protected], example.com.

  • notification_type (NotificationType) –

    The notification type for which to enable or disable headers in notifications.

  • enabled (Enabled) –

    Sets whether Amazon SES includes the original email headers in Amazon SNS notifications of the specified notification type. A value of true specifies that Amazon SES includes headers in notifications, and a value of false specifies that Amazon SES does not include headers in notifications.

    This value can only be set when NotificationType is already set to use a particular Amazon SNS topic.

Raises:

Examples:

SetIdentityHeadersInNotificationsEnabled The following example configures Amazon SES to include the original email headers in the Amazon SNS bounce notifications for an identity:

>>> client.set_identity_headers_in_notifications_enabled(identity='[email protected]', notification_type='Bounce', enabled=True)
Source code in docs_src/capo_ses/_services/ses.py
def set_identity_headers_in_notifications_enabled(
    self,
    identity: "capo_ses.types.identity.Identity",
    notification_type: "capo_ses.types.notification_type.NotificationType",
    enabled: "capo_ses.types.enabled.Enabled",
    *,
    config_overrides: Optional[SESClientConfig] = None,
) -> "capo_ses.types.set_identity_headers_in_notifications_enabled_response.SetIdentityHeadersInNotificationsEnabledResponse":
    """<p>Given an identity (an email address or a domain), sets whether Amazon SES includes the original email headers in the Amazon Simple Notification Service (Amazon SNS) notifications of a specified type.</p> <p>You can execute this operation no more than once per second.</p> <p>For more information about using notifications with Amazon SES, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html">Amazon SES Developer Guide</a>.</p>

    Args:
        identity: <p>The identity for which to enable or disable headers in notifications. Examples: <code>[email protected]</code>, <code>example.com</code>.</p>
        notification_type: <p>The notification type for which to enable or disable headers in notifications. </p>
        enabled: <p>Sets whether Amazon SES includes the original email headers in Amazon SNS notifications of the specified notification type. A value of <code>true</code> specifies that Amazon SES includes headers in notifications, and a value of <code>false</code> specifies that Amazon SES does not include headers in notifications.</p> <p>This value can only be set when <code>NotificationType</code> is already set to use a particular Amazon SNS topic.</p>

    Raises:
        capo_ses.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        SetIdentityHeadersInNotificationsEnabled
        The following example configures Amazon SES to include the original email headers in the Amazon SNS bounce notifications for an identity:

        >>> client.set_identity_headers_in_notifications_enabled(identity='[email protected]', notification_type='Bounce', enabled=True)
    """

    def _handler(
        req: "OperationRequest[capo_ses.types.set_identity_headers_in_notifications_enabled_request.SetIdentityHeadersInNotificationsEnabledRequest]",
    ) -> OperationResponse[
        "capo_ses.types.set_identity_headers_in_notifications_enabled_response.SetIdentityHeadersInNotificationsEnabledResponse"
    ]:
        import capo_ses._operations.simple_email_service.set_identity_headers_in_notifications_enabled

        output, http_response = (
            capo_ses._operations.simple_email_service.set_identity_headers_in_notifications_enabled.set_identity_headers_in_notifications_enabled(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SetIdentityHeadersInNotificationsEnabled"),
    )
    input_: capo_ses.types.set_identity_headers_in_notifications_enabled_request.SetIdentityHeadersInNotificationsEnabledRequest = {
        "identity": identity,
        "notification_type": notification_type,
        "enabled": enabled,
    }

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