Skip to content

Commit

Permalink
Update to use the resource MyEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdale99 committed Nov 13, 2024
1 parent 819d980 commit 0fd3bfa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 32 deletions.
16 changes: 2 additions & 14 deletions emails/subscribed.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
16 changes: 2 additions & 14 deletions emails/unsubscribed.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
3 changes: 0 additions & 3 deletions sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
3 changes: 2 additions & 1 deletion utils/email.ts
Original file line number Diff line number Diff line change
@@ -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<any>
Expand All @@ -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 || [],
},
Expand Down

0 comments on commit 0fd3bfa

Please sign in to comment.