Skip to content

CustomVerificationEmailTemplate

Source: src/AWS/SES/CustomVerificationEmailTemplate.ts

An Amazon SES v2 custom verification email template — the branded email SES sends when you verify a new email-address identity via SendCustomVerificationEmail.

Creating, reading, updating, and deleting the template works on any account. Actually sending a custom verification email requires the account to be out of the SES sandbox (production access).

Branded Verification Email

import * as SES from "alchemy/AWS/SES";
const template = yield* SES.CustomVerificationEmailTemplate("Verify", {
fromEmailAddress: "verify@example.com",
templateSubject: "Please confirm your email",
templateContent:
"<html><body>Click the link to verify your address.</body></html>",
successRedirectionURL: "https://example.com/verified",
failureRedirectionURL: "https://example.com/verify-failed",
});

Explicit Template Name

// Without templateName a deterministic name is derived from app/stage/id.
const template = yield* SES.CustomVerificationEmailTemplate("Verify", {
templateName: "onboarding-verification",
fromEmailAddress: "verify@example.com",
templateSubject: "Please confirm your email",
templateContent:
"<html><body>Click the link to verify your address.</body></html>",
successRedirectionURL: "https://example.com/verified",
failureRedirectionURL: "https://example.com/verify-failed",
});
// init — account-level binding, no resource argument
const sendVerification = yield* SES.SendCustomVerificationEmail();
// runtime — SES emails the branded template to the address, and the
// address becomes a verified identity once the recipient clicks through.
const { MessageId } = yield* sendVerification({
EmailAddress: "new-user@example.com",
TemplateName: yield* template.templateName,
});