Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use the resource MyEmail #9

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading