diff --git a/emails/subscribed.tsx b/emails/subscribed.tsx index 9301a7a..80f75aa 100644 --- a/emails/subscribed.tsx +++ b/emails/subscribed.tsx @@ -1,18 +1,6 @@ -import { - Body, - Button, - Container, - Head, - Hr, - Html, - Img, - Link, - Preview, - Section, - Text, -} from "@react-email/components"; +import { Text } from "@react-email/components"; import * as React from "react"; -import { EmailWrapper, url } from "."; +import { EmailWrapper } from "."; const Subscribed: React.FC = () => { return ( diff --git a/emails/unsubscribed.tsx b/emails/unsubscribed.tsx index 808a109..db092b5 100644 --- a/emails/unsubscribed.tsx +++ b/emails/unsubscribed.tsx @@ -1,18 +1,6 @@ -import { - Body, - Button, - Container, - Head, - Hr, - Html, - Img, - Link, - Preview, - Section, - Text, -} from "@react-email/components"; +import { Text } from "@react-email/components"; import * as React from "react"; -import { EmailWrapper, url } from "."; +import { EmailWrapper } from "."; const Unsubscribed: React.FC = () => { return ( diff --git a/sst.config.ts b/sst.config.ts index 400c4f5..091c1e6 100644 --- a/sst.config.ts +++ b/sst.config.ts @@ -10,9 +10,6 @@ export default $config({ }; }, async run() { - const email = new sst.aws.Email("MyEmail", { - sender: "lucas@strukt.io", - }); const database_url = new sst.Secret("DATABASE_URL"); const next_public_url = new sst.Secret("NEXT_PUBLIC_URL"); new sst.aws.Nextjs("letusdev", { diff --git a/utils/email.ts b/utils/email.ts index 7ca7cc9..ff64d28 100644 --- a/utils/email.ts +++ b/utils/email.ts @@ -1,6 +1,7 @@ import { render } from "@react-email/render"; import React from "react"; import { SESv2Client, SendEmailCommand } from "@aws-sdk/client-sesv2"; +import { Resource } from "sst"; type ReactComponent = | React.FunctionComponent @@ -25,7 +26,7 @@ export async function mail(template: ReactComponent, mail: MailProps) { const send = async () => await new SESv2Client().send( new SendEmailCommand({ - FromEmailAddress: "lucas@strukt.io", + FromEmailAddress: Resource.MyEmail.sender, Destination: { ToAddresses: mail.to || [], },