EmailTemplate
Source:
src/AWS/SES/EmailTemplate.ts
An Amazon SES v2 email template — reusable subject/text/HTML content with
{{variable}} personalization tags, rendered server-side when you send
templated email.
Creating Templates
Section titled “Creating Templates”import * as SES from "alchemy/AWS/SES";
const template = yield* SES.EmailTemplate("Welcome", { subject: "Welcome, {{name}}!", text: "Hi {{name}}, thanks for signing up.", html: "<h1>Hi {{name}}</h1><p>Thanks for signing up.</p>",});Sending Templated Email
Section titled “Sending Templated Email”const sendEmail = yield* SES.SendEmail(identity);
const result = yield* sendEmail({ Destination: { ToAddresses: ["customer@example.com"] }, Content: { Template: { TemplateName: "my-welcome-template", TemplateData: JSON.stringify({ name: "Ada" }), }, },});