Skip to content

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.

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>",
});
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" }),
},
},
});