AWS JSX Email
Uses JSX Email and the Email component to design and send emails.
To test this example, change the sst.config.ts to use your own email address.
sender: "email@example.com"Then run.
npm installnpx sst devYou’ll get an email from AWS asking you to confirm your email address. Click the link to verify it.
Next, go to the URL in the sst dev CLI output. You should now receive an email rendered
using JSX Email.
import { Template } from "./templates/email";
await render(Template({ email: "spongebob@example.com", name: "Spongebob Squarepants"}))Once you are ready to go to production, you can:
- Request production access for SES
- And use your domain to send emails
const email = new sst.aws.Email("MyEmail", { sender: "email@example.com",});const api = new sst.aws.Function("MyApi", { handler: "index.handler", link: [email], url: true,});View the full example.