EmailIdentity
Source:
src/AWS/SES/EmailIdentity.ts
An Amazon SES v2 email identity — a verified email address or domain that you send email from.
Creating the identity starts verification: email-address identities receive
a verification email, and domain identities get Easy DKIM tokens (exposed
as the dkimTokens attribute) to publish as CNAME records. The identity
is usable for sending once verificationStatus is SUCCESS.
Creating Identities
Section titled “Creating Identities”Domain Identity
import * as SES from "alchemy/AWS/SES";
const identity = yield* SES.EmailIdentity("Sender", { emailIdentity: "mail.example.com",});// publish identity.dkimTokens as CNAME records to verifyEmail Address Identity
const identity = yield* SES.EmailIdentity("Sender", { emailIdentity: "hello@example.com",});// SES emails hello@example.com a verification linkConfiguration Set Association
Section titled “Configuration Set Association”const configSet = yield* SES.ConfigurationSet("Tracking", {});const identity = yield* SES.EmailIdentity("Sender", { emailIdentity: "mail.example.com", configurationSetName: configSet.configurationSetName,});Sending Email at Runtime
Section titled “Sending Email at Runtime”// initconst sendEmail = yield* SES.SendEmail(identity);
// runtimeconst result = yield* sendEmail({ FromEmailAddress: "hello@mail.example.com", Destination: { ToAddresses: ["customer@example.com"] }, Content: { Simple: { Subject: { Data: "Welcome!" }, Body: { Text: { Data: "Hello from SES." } }, }, },});