Skip to content

update_email_template

update_email_template(
    template_name: EmailTemplateName,
    template_content: EmailTemplateContent,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> UpdateEmailTemplateResponse

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

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

Parameters:

  • template_name (EmailTemplateName) –

    The name of the template.

  • template_content (EmailTemplateContent) –

    The content of the email template, composed of a subject line, an HTML part, and a text-only part.

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def update_email_template(
    self,
    template_name: "capo_sesv2.types.email_template_name.EmailTemplateName",
    template_content: "capo_sesv2.types.email_template_content.EmailTemplateContent",
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> "capo_sesv2.types.update_email_template_response.UpdateEmailTemplateResponse":
    """<p>Updates an email template. Email templates enable you to send personalized email to one or more destinations in a single API operation. For more information, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html">Amazon SES Developer Guide</a>.</p> <p>You can execute this operation no more than once per second.</p>

    Args:
        template_name: <p>The name of the template.</p>
        template_content: <p>The content of the email template, composed of a subject line, an HTML part, and a text-only part.</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.update_email_template_request.UpdateEmailTemplateRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.update_email_template_response.UpdateEmailTemplateResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.update_email_template

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEmailTemplate")
    )
    input_: capo_sesv2.types.update_email_template_request.UpdateEmailTemplateRequest = {
        "template_name": template_name,
        "template_content": template_content,
    }

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