Skip to content

update_template async

update_template(
    template: Template, *, config_overrides: Optional[AsyncSESClientConfig] = None
) -> UpdateTemplateResponse

Updates an email template. Email templates enable you to send personalized email to one or more destinations in a single operation. For more information, see the Amazon SES Developer Guide.

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

Raises:

  • InvalidTemplateException –

    Indicates that the template that you specified could not be rendered. This issue may occur when a template refers to a partial that does not exist.

  • TemplateDoesNotExistException –

    Indicates that the Template object you specified does not exist in your Amazon SES account.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_ses/_services/async_ses.py
async def update_template(
    self,
    template: "capo_ses.types.template.Template",
    *,
    config_overrides: Optional[AsyncSESClientConfig] = None,
) -> "capo_ses.types.update_template_response.UpdateTemplateResponse":
    """<p>Updates an email template. Email templates enable you to send personalized email to one or more destinations in a single operation. For more information, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html">Amazon SES Developer Guide</a>.</p> <p>You can execute this operation no more than once per second.</p>

    Raises:
        capo_ses.errors.invalid_template_exception.InvalidTemplateException: <p>Indicates that the template that you specified could not be rendered. This issue may occur when a template refers to a partial that does not exist.</p>
        capo_ses.errors.template_does_not_exist_exception.TemplateDoesNotExistException: <p>Indicates that the Template object you specified does not exist in your Amazon SES account.</p>
        capo_ses.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ses.types.update_template_request.UpdateTemplateRequest]",
    ) -> AsyncOperationResponse[
        "capo_ses.types.update_template_response.UpdateTemplateResponse"
    ]:
        import capo_ses._operations.simple_email_service.update_template

        (
            output,
            http_response,
        ) = await capo_ses._operations.simple_email_service.update_template.async_update_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTemplate")
    )
    input_: capo_ses.types.update_template_request.UpdateTemplateRequest = {
        "template": template
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output