Skip to content

send_custom_verification_email

send_custom_verification_email(
    email_address: Address,
    template_name: TemplateName,
    *,
    config_overrides: Optional[SESClientConfig] = None,
    configuration_set_name: Optional[ConfigurationSetName] = None,
) -> SendCustomVerificationEmailResponse

Adds an email address to the list of identities for your Amazon SES account in the current Amazon Web Services Region and attempts to verify it. As a result of executing this operation, a customized verification email is sent to the specified address.

To use this operation, you must first create a custom verification email template. For more information about creating and using custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer Guide.

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

Parameters:

  • email_address (Address) –

    The email address to verify.

  • template_name (TemplateName) –

    The name of the custom verification email template to use when sending the verification email.

  • configuration_set_name (Optional[ConfigurationSetName], default: None ) –

    Name of a configuration set to use when sending the verification email.

Raises:

Source code in docs_src/capo_ses/_services/ses.py
def send_custom_verification_email(
    self,
    email_address: "capo_ses.types.address.Address",
    template_name: "capo_ses.types.template_name.TemplateName",
    *,
    config_overrides: Optional[SESClientConfig] = None,
    configuration_set_name: Optional[
        "capo_ses.types.configuration_set_name.ConfigurationSetName"
    ] = None,
) -> "capo_ses.types.send_custom_verification_email_response.SendCustomVerificationEmailResponse":
    """<p>Adds an email address to the list of identities for your Amazon SES account in the current Amazon Web Services Region and attempts to verify it. As a result of executing this operation, a customized verification email is sent to the specified address.</p> <p>To use this operation, you must first create a custom verification email template. For more information about creating and using custom verification email templates, see <a href="https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom">Using Custom Verification Email Templates</a> in the <i>Amazon SES Developer Guide</i>.</p> <p>You can execute this operation no more than once per second.</p>

    Args:
        email_address: <p>The email address to verify.</p>
        template_name: <p>The name of the custom verification email template to use when sending the verification email.</p>
        configuration_set_name: <p>Name of a configuration set to use when sending the verification email.</p>

    Raises:
        capo_ses.errors.configuration_set_does_not_exist_exception.ConfigurationSetDoesNotExistException: <p>Indicates that the configuration set does not exist.</p>
        capo_ses.errors.custom_verification_email_template_does_not_exist_exception.CustomVerificationEmailTemplateDoesNotExistException: <p>Indicates that a custom verification email template with the name you specified does not exist.</p>
        capo_ses.errors.from_email_address_not_verified_exception.FromEmailAddressNotVerifiedException: <p>Indicates that the sender address specified for a custom verification email is not verified, and is therefore not eligible to send the custom verification email. </p>
        capo_ses.errors.message_rejected.MessageRejected: <p>Indicates that the action failed, and the message could not be sent. Check the error stack for more information about what caused the error.</p>
        capo_ses.errors.production_access_not_granted_exception.ProductionAccessNotGrantedException: <p>Indicates that the account has not been granted production access.</p>
        capo_ses.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ses.types.send_custom_verification_email_request.SendCustomVerificationEmailRequest]",
    ) -> OperationResponse[
        "capo_ses.types.send_custom_verification_email_response.SendCustomVerificationEmailResponse"
    ]:
        import capo_ses._operations.simple_email_service.send_custom_verification_email

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SendCustomVerificationEmail")
    )
    input_: capo_ses.types.send_custom_verification_email_request.SendCustomVerificationEmailRequest = {
        "email_address": email_address,
        "template_name": template_name,
    }
    if configuration_set_name is not None:
        input_["configuration_set_name"] = configuration_set_name

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