Skip to content

get_message_insights

get_message_insights(
    message_id: OutboundMessageId,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> GetMessageInsightsResponse

Provides information about a specific message, including the from address, the subject, the recipient address, email tags, as well as events associated with the message.

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

Parameters:

  • message_id (OutboundMessageId) –

    A MessageId is a unique identifier for a message, and is returned when sending emails through Amazon SES.

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def get_message_insights(
    self,
    message_id: "capo_sesv2.types.outbound_message_id.OutboundMessageId",
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> "capo_sesv2.types.get_message_insights_response.GetMessageInsightsResponse":
    """<p>Provides information about a specific message, including the from address, the subject, the recipient address, email tags, as well as events associated with the message.</p> <p>You can execute this operation no more than once per second.</p>

    Args:
        message_id: <p> A <code>MessageId</code> is a unique identifier for a message, and is returned when sending emails through Amazon SES. </p>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sesv2.types.get_message_insights_request.GetMessageInsightsRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.get_message_insights_response.GetMessageInsightsResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.get_message_insights

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.get_message_insights.get_message_insights(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_sesv2.types.get_message_insights_response.GetMessageInsightsResponse",
    ) -> dict[str, Any]:
        import capo_sesv2.types.get_message_insights_response

        return capo_sesv2.types.get_message_insights_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetMessageInsights", redact_output=_redact_output),
    )
    input_: capo_sesv2.types.get_message_insights_request.GetMessageInsightsRequest = {
        "message_id": message_id
    }

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