Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

move templates to dub/templates

Kiran Ka6ba1f1e6ea1
diff --git a/apps/web/emails/index.ts b/apps/web/emails/index.ts
deleted file mode 100644
index 31b8de23ed..0000000000
--- a/apps/web/emails/index.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { resend } from "@/lib/resend";
-import { render } from "@react-email/components";
-import nodemailer from "nodemailer";
-import { ReactElement } from "react";
-import { CreateEmailOptions } from "resend";
-import { sendEmailViaResend } from "./send-via-resend";
-
-// Send email using SMTP (Recommended for local development)
-const sendEmailViaSMTP = async ({
- email,
- subject,
- text,
- react,
-}: Pick<CreateEmailOptions, "subject" | "text" | "react"> & {
- email: string;
-}) => {
- const transporter = nodemailer.createTransport({
- host: process.env.SMTP_HOST,
- port: process.env.SMTP_PORT,
- auth: {
- user: process.env.SMTP_USER,
- pass: process.env.SMTP_PASSWORD,
- },
- secure: false,
- tls: {
- rejectUnauthorized: false,
- },
- });
-
- const info = await transporter.sendMail({
- to: email,
- subject,
- text,
- html: render(react as ReactElement),
- });
-
- console.info("Email sent: %s", info.messageId);
-};
-
-export const sendEmail = async ({
- email,
- subject,
- from,
- bcc,
- replyToFromEmail,
- text,
- react,
- scheduledAt,
- marketing,
-}: Omit<CreateEmailOptions, "to" | "from"> & {
- email: string;
- from?: string;
- replyToFromEmail?: boolean;
- marketing?: boolean;
-}) => {
- if (resend) {
- return await sendEmailViaResend({
- email,
- subject,
- from,
- bcc,
- replyToFromEmail,
- text,
- react,
- scheduledAt,
- marketing,
- });
- }
-
- // Fallback to SMTP if Resend is not configured
- const smtpConfigured = Boolean(
- process.env.SMTP_HOST && process.env.SMTP_PORT,
- );
-
- if (smtpConfigured) {
- return await sendEmailViaSMTP({
- email,
- subject,
- text,
- react,
- });
- }
-
- console.info(
- "Email sending failed: Neither SMTP nor Resend is configured. Please set up at least one email service to send emails.",
- );
-};
diff --git a/packages/email/package.json b/packages/email/package.json
index 5f174bea0a..999970d19e 100644
--- a/packages/email/package.json
+++ b/packages/email/package.json
@@ -10,7 +10,9 @@
"dependencies": {
"@dub/utils": "workspace:*",
"@react-email/components": "^0.0.22",
- "react-email": "^2.1.6"
+ "react-email": "^2.1.6",
+ "lucide-react": "^0.462.0",
+ "resend": "^4.0.0"
},
"devDependencies": {
"typescript": "^5.4.4",
diff --git a/packages/email/src/index.ts b/packages/email/src/index.ts
index e69de29bb2..cb0ff5c3b5 100644
--- a/packages/email/src/index.ts
+++ b/packages/email/src/index.ts
@@ -0,0 +1 @@
+export {};
diff --git a/apps/web/emails/clicks-exceeded.tsx b/packages/email/src/templates/clicks-exceeded.tsx
similarity index 96%
rename from apps/web/emails/clicks-exceeded.tsx
rename to packages/email/src/templates/clicks-exceeded.tsx
index 5bc8b4c7da..e505d67874 100644
--- a/apps/web/emails/clicks-exceeded.tsx
+++ b/packages/email/src/templates/clicks-exceeded.tsx
@@ -12,10 +12,10 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import { WorkspaceProps } from "../lib/types";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
+import { WorkspaceProps } from "../types";
-export default function ClicksExceeded({
+export function ClicksExceeded({
email = "[email protected]",
workspace = {
id: "ckqf1q3xw0000gk5u2q1q2q1q",
diff --git a/apps/web/emails/clicks-summary.tsx b/packages/email/src/templates/clicks-summary.tsx
similarity index 98%
rename from apps/web/emails/clicks-summary.tsx
rename to packages/email/src/templates/clicks-summary.tsx
index 0a05cd60d9..da1641aff8 100644
--- a/apps/web/emails/clicks-summary.tsx
+++ b/packages/email/src/templates/clicks-summary.tsx
@@ -16,9 +16,9 @@ import {
Text,
} from "@react-email/components";
import { Link2, MousePointerClick } from "lucide-react";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function ClicksSummary({
+export function ClicksSummary({
email = "[email protected]",
appName = "Dub.co",
appDomain = "dub.co",
diff --git a/apps/web/emails/domain-claimed.tsx b/packages/email/src/templates/domain-claimed.tsx
similarity index 96%
rename from apps/web/emails/domain-claimed.tsx
rename to packages/email/src/templates/domain-claimed.tsx
index 6c75f09cda..14579719a5 100644
--- a/apps/web/emails/domain-claimed.tsx
+++ b/packages/email/src/templates/domain-claimed.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function DomainClaimed({
+export function DomainClaimed({
email = "[email protected]",
domain = "dub.link",
workspaceSlug = "dub",
diff --git a/apps/web/emails/domain-deleted.tsx b/packages/email/src/templates/domain-deleted.tsx
similarity index 96%
rename from apps/web/emails/domain-deleted.tsx
rename to packages/email/src/templates/domain-deleted.tsx
index 8729c8a88f..92488bb912 100644
--- a/apps/web/emails/domain-deleted.tsx
+++ b/packages/email/src/templates/domain-deleted.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function DomainDeleted({
+export function DomainDeleted({
email = "[email protected]",
domain = "dub.sh",
workspaceSlug = "dub",
diff --git a/apps/web/emails/domain-transferred.tsx b/packages/email/src/templates/domain-transferred.tsx
similarity index 90%
rename from apps/web/emails/domain-transferred.tsx
rename to packages/email/src/templates/domain-transferred.tsx
index bd401be43c..216833c3d4 100644
--- a/apps/web/emails/domain-transferred.tsx
+++ b/packages/email/src/templates/domain-transferred.tsx
@@ -1,4 +1,3 @@
-import { Project } from "@dub/prisma/client";
import { DUB_WORDMARK } from "@dub/utils";
import {
Body,
@@ -13,9 +12,10 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
+import { WorkspaceProps } from "../types";
-export default function DomainTransferred({
+export function DomainTransferred({
email = "[email protected]",
domain = "dub.sh",
newWorkspace = { name: "Dub", slug: "dub" },
@@ -23,7 +23,7 @@ export default function DomainTransferred({
}: {
email: string;
domain: string;
- newWorkspace: Pick<Project, "name" | "slug">;
+ newWorkspace: Pick<WorkspaceProps, "name" | "slug">;
linksCount: number;
}) {
return (
diff --git a/apps/web/emails/failed-payment.tsx b/packages/email/src/templates/failed-payment.tsx
similarity index 97%
rename from apps/web/emails/failed-payment.tsx
rename to packages/email/src/templates/failed-payment.tsx
index d2af513901..ce9058d14c 100644
--- a/apps/web/emails/failed-payment.tsx
+++ b/packages/email/src/templates/failed-payment.tsx
@@ -13,9 +13,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function FailedPayment({
+export function FailedPayment({
user = { name: "Brendon Urie", email: "[email protected]" },
workspace = { name: "Dub", slug: "dub" },
amountDue = 2400,
diff --git a/apps/web/emails/feedback-email.tsx b/packages/email/src/templates/feedback-email.tsx
similarity index 96%
rename from apps/web/emails/feedback-email.tsx
rename to packages/email/src/templates/feedback-email.tsx
index 2be2cd84f2..dff489c0f8 100644
--- a/apps/web/emails/feedback-email.tsx
+++ b/packages/email/src/templates/feedback-email.tsx
@@ -12,7 +12,7 @@ import {
Text,
} from "@react-email/components";
-export default function FeedbackEmail({
+export function FeedbackEmail({
email = "[email protected]",
feedback = "I love Dub!",
}: {
diff --git a/packages/email/src/templates/index.ts b/packages/email/src/templates/index.ts
index 693da49fc4..31b8de23ed 100644
--- a/packages/email/src/templates/index.ts
+++ b/packages/email/src/templates/index.ts
@@ -1 +1,88 @@
-export {}
\ No newline at end of file
+import { resend } from "@/lib/resend";
+import { render } from "@react-email/components";
+import nodemailer from "nodemailer";
+import { ReactElement } from "react";
+import { CreateEmailOptions } from "resend";
+import { sendEmailViaResend } from "./send-via-resend";
+
+// Send email using SMTP (Recommended for local development)
+const sendEmailViaSMTP = async ({
+ email,
+ subject,
+ text,
+ react,
+}: Pick<CreateEmailOptions, "subject" | "text" | "react"> & {
+ email: string;
+}) => {
+ const transporter = nodemailer.createTransport({
+ host: process.env.SMTP_HOST,
+ port: process.env.SMTP_PORT,
+ auth: {
+ user: process.env.SMTP_USER,
+ pass: process.env.SMTP_PASSWORD,
+ },
+ secure: false,
+ tls: {
+ rejectUnauthorized: false,
+ },
+ });
+
+ const info = await transporter.sendMail({
+ to: email,
+ subject,
+ text,
+ html: render(react as ReactElement),
+ });
+
+ console.info("Email sent: %s", info.messageId);
+};
+
+export const sendEmail = async ({
+ email,
+ subject,
+ from,
+ bcc,
+ replyToFromEmail,
+ text,
+ react,
+ scheduledAt,
+ marketing,
+}: Omit<CreateEmailOptions, "to" | "from"> & {
+ email: string;
+ from?: string;
+ replyToFromEmail?: boolean;
+ marketing?: boolean;
+}) => {
+ if (resend) {
+ return await sendEmailViaResend({
+ email,
+ subject,
+ from,
+ bcc,
+ replyToFromEmail,
+ text,
+ react,
+ scheduledAt,
+ marketing,
+ });
+ }
+
+ // Fallback to SMTP if Resend is not configured
+ const smtpConfigured = Boolean(
+ process.env.SMTP_HOST && process.env.SMTP_PORT,
+ );
+
+ if (smtpConfigured) {
+ return await sendEmailViaSMTP({
+ email,
+ subject,
+ text,
+ react,
+ });
+ }
+
+ console.info(
+ "Email sending failed: Neither SMTP nor Resend is configured. Please set up at least one email service to send emails.",
+ );
+};
diff --git a/apps/web/emails/integration-installed.tsx b/packages/email/src/templates/integration-installed.tsx
similarity index 95%
rename from apps/web/emails/integration-installed.tsx
rename to packages/email/src/templates/integration-installed.tsx
index 14fff8dff9..4460536776 100644
--- a/apps/web/emails/integration-installed.tsx
+++ b/packages/email/src/templates/integration-installed.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function IntegrationInstalled({
+export function IntegrationInstalled({
email = "[email protected]",
workspace = {
name: "Acme, Inc",
diff --git a/apps/web/emails/invalid-domain.tsx b/packages/email/src/templates/invalid-domain.tsx
similarity index 97%
rename from apps/web/emails/invalid-domain.tsx
rename to packages/email/src/templates/invalid-domain.tsx
index c1283e7305..879e0718b3 100644
--- a/apps/web/emails/invalid-domain.tsx
+++ b/packages/email/src/templates/invalid-domain.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function InvalidDomain({
+export function InvalidDomain({
email = "[email protected]",
domain = "dub.sh",
workspaceSlug = "dub",
diff --git a/apps/web/emails/links-import-errors.tsx b/packages/email/src/templates/links-import-errors.tsx
similarity index 98%
rename from apps/web/emails/links-import-errors.tsx
rename to packages/email/src/templates/links-import-errors.tsx
index a26e5b5b3c..2b0c61f77a 100644
--- a/apps/web/emails/links-import-errors.tsx
+++ b/packages/email/src/templates/links-import-errors.tsx
@@ -15,7 +15,7 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
const MAX_ERROR_LINKS = 20;
diff --git a/apps/web/emails/links-imported.tsx b/packages/email/src/templates/links-imported.tsx
similarity index 98%
rename from apps/web/emails/links-imported.tsx
rename to packages/email/src/templates/links-imported.tsx
index 4bf6115c3d..419a664cbd 100644
--- a/apps/web/emails/links-imported.tsx
+++ b/packages/email/src/templates/links-imported.tsx
@@ -15,9 +15,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function LinksImported({
+export function LinksImported({
email = "[email protected]",
provider = "Bitly",
count = 1020,
diff --git a/apps/web/emails/links-limit.tsx b/packages/email/src/templates/links-limit.tsx
similarity index 96%
rename from apps/web/emails/links-limit.tsx
rename to packages/email/src/templates/links-limit.tsx
index c83c78a92c..d594e7fe1b 100644
--- a/apps/web/emails/links-limit.tsx
+++ b/packages/email/src/templates/links-limit.tsx
@@ -12,10 +12,10 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import { WorkspaceProps } from "../lib/types";
-import Footer from "./components/footer";
+import { WorkspaceProps } from "../../../../apps/web/lib/types";
+import { Footer } from "../components/footer";
-export default function LinksLimitAlert({
+export function LinksLimitAlert({
email = "[email protected]",
workspace = {
id: "ckqf1q3xw0000gk5u2q1q2q1q",
diff --git a/apps/web/emails/login-link.tsx b/packages/email/src/templates/login-link.tsx
similarity index 96%
rename from apps/web/emails/login-link.tsx
rename to packages/email/src/templates/login-link.tsx
index 73df76385d..13372fb547 100644
--- a/apps/web/emails/login-link.tsx
+++ b/packages/email/src/templates/login-link.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function LoginLink({
+export function LoginLink({
email = "[email protected]",
url = "http://localhost:8888/api/auth/callback/email?callbackUrl=http%3A%2F%2Fapp.localhost%3A3000%2Flogin&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&[email protected]",
}: {
diff --git a/apps/web/emails/new-referral-signup.tsx b/packages/email/src/templates/new-referral-signup.tsx
similarity index 94%
rename from apps/web/emails/new-referral-signup.tsx
rename to packages/email/src/templates/new-referral-signup.tsx
index 89ea9205b4..922c2b35a1 100644
--- a/apps/web/emails/new-referral-signup.tsx
+++ b/packages/email/src/templates/new-referral-signup.tsx
@@ -1,4 +1,3 @@
-import { REFERRAL_CLICKS_QUOTA_BONUS } from "@/lib/embed/constants";
import { DUB_WORDMARK, getPrettyUrl } from "@dub/utils";
import {
Body,
@@ -13,9 +12,11 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function NewReferralSignup({
+export const REFERRAL_CLICKS_QUOTA_BONUS = 500;
+
+export function NewReferralSignup({
email = "[email protected]",
workspace = {
name: "Acme, Inc",
diff --git a/apps/web/emails/new-sale-created.tsx b/packages/email/src/templates/new-sale-created.tsx
similarity index 97%
rename from apps/web/emails/new-sale-created.tsx
rename to packages/email/src/templates/new-sale-created.tsx
index a178f7703c..2dc67b3a82 100644
--- a/apps/web/emails/new-sale-created.tsx
+++ b/packages/email/src/templates/new-sale-created.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function NewSaleCreated({
+export function NewSaleCreated({
email = "[email protected]",
partner = {
id: "pn_OfewI1Faaf5pV8QH3mha8L7S",
diff --git a/apps/web/emails/partner-invite.tsx b/packages/email/src/templates/partner-invite.tsx
similarity index 95%
rename from apps/web/emails/partner-invite.tsx
rename to packages/email/src/templates/partner-invite.tsx
index 7e8af6c51d..b8e5d5c2dd 100644
--- a/apps/web/emails/partner-invite.tsx
+++ b/packages/email/src/templates/partner-invite.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function PartnerInvite({
+export function PartnerInvite({
email = "[email protected]",
appName = "Dub.co",
program = {
diff --git a/apps/web/emails/partner-payout-sent.tsx b/packages/email/src/templates/partner-payout-sent.tsx
similarity index 96%
rename from apps/web/emails/partner-payout-sent.tsx
rename to packages/email/src/templates/partner-payout-sent.tsx
index 24e0a889bb..40962d936f 100644
--- a/apps/web/emails/partner-payout-sent.tsx
+++ b/packages/email/src/templates/partner-payout-sent.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function PartnerPayoutSent({
+export function PartnerPayoutSent({
email = "[email protected]",
program = {
id: "prog_d8pl69xXCv4AoHNT281pHQdo",
diff --git a/apps/web/emails/password-updated.tsx b/packages/email/src/templates/password-updated.tsx
similarity index 94%
rename from apps/web/emails/password-updated.tsx
rename to packages/email/src/templates/password-updated.tsx
index 6ad361d819..a67d421afc 100644
--- a/apps/web/emails/password-updated.tsx
+++ b/packages/email/src/templates/password-updated.tsx
@@ -11,9 +11,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function PasswordUpdated({
+export function PasswordUpdated({
email = "[email protected]",
verb = "updated",
}: {
diff --git a/apps/web/emails/rebrand-email.tsx b/packages/email/src/templates/rebrand-email.tsx
similarity index 98%
rename from apps/web/emails/rebrand-email.tsx
rename to packages/email/src/templates/rebrand-email.tsx
index a02bd08612..450e9e8a24 100644
--- a/apps/web/emails/rebrand-email.tsx
+++ b/packages/email/src/templates/rebrand-email.tsx
@@ -13,9 +13,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function RebrandEmail({
+export function RebrandEmail({
name = "Brendon Urie",
email = "[email protected]",
}: {
diff --git a/apps/web/emails/referral-invite.tsx b/packages/email/src/templates/referral-invite.tsx
similarity index 96%
rename from apps/web/emails/referral-invite.tsx
rename to packages/email/src/templates/referral-invite.tsx
index dcb954ca36..af1804e108 100644
--- a/apps/web/emails/referral-invite.tsx
+++ b/packages/email/src/templates/referral-invite.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function ReferralInvite({
+export function ReferralInvite({
email = "[email protected]",
appName = "Dub.co",
url = "https://dub.co",
diff --git a/apps/web/emails/reset-password-link.tsx b/packages/email/src/templates/reset-password-link.tsx
similarity index 96%
rename from apps/web/emails/reset-password-link.tsx
rename to packages/email/src/templates/reset-password-link.tsx
index fd8faf301d..cbbf5eb546 100644
--- a/apps/web/emails/reset-password-link.tsx
+++ b/packages/email/src/templates/reset-password-link.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function ResetPasswordLink({
+export function ResetPasswordLink({
email = "[email protected]",
url = "http://localhost:8888/auth/reset-password/adaf8468f590e70bb60fe40983321c2719c7bdc694063bd2437c1f8a53f7c90a",
}: {
diff --git a/apps/web/emails/send-via-resend.ts b/packages/email/src/templates/send-via-resend.ts
similarity index 100%
rename from apps/web/emails/send-via-resend.ts
rename to packages/email/src/templates/send-via-resend.ts
diff --git a/apps/web/emails/upgrade-email.tsx b/packages/email/src/templates/upgrade-email.tsx
similarity index 97%
rename from apps/web/emails/upgrade-email.tsx
rename to packages/email/src/templates/upgrade-email.tsx
index d023fd5f89..b8bbd8c1d5 100644
--- a/apps/web/emails/upgrade-email.tsx
+++ b/packages/email/src/templates/upgrade-email.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function UpgradeEmail({
+export function UpgradeEmail({
name = "Brendon Urie",
email = "[email protected]",
plan = "Pro",
diff --git a/apps/web/emails/verify-email.tsx b/packages/email/src/templates/verify-email.tsx
similarity index 95%
rename from apps/web/emails/verify-email.tsx
rename to packages/email/src/templates/verify-email.tsx
index c3e6ee299d..4f96c3791a 100644
--- a/apps/web/emails/verify-email.tsx
+++ b/packages/email/src/templates/verify-email.tsx
@@ -11,9 +11,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function VerifyEmail({
+export function VerifyEmail({
email = "[email protected]",
code = "123456",
}: {
diff --git a/apps/web/emails/webhook-added.tsx b/packages/email/src/templates/webhook-added.tsx
similarity index 96%
rename from apps/web/emails/webhook-added.tsx
rename to packages/email/src/templates/webhook-added.tsx
index 94a81496c6..56622587fd 100644
--- a/apps/web/emails/webhook-added.tsx
+++ b/packages/email/src/templates/webhook-added.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function WebhookAdded({
+export function WebhookAdded({
email = "[email protected]",
workspace = {
name: "Acme, Inc",
diff --git a/apps/web/emails/welcome-email.tsx b/packages/email/src/templates/welcome-email.tsx
similarity index 97%
rename from apps/web/emails/welcome-email.tsx
rename to packages/email/src/templates/welcome-email.tsx
index 9170ad1a36..c0d94a4044 100644
--- a/apps/web/emails/welcome-email.tsx
+++ b/packages/email/src/templates/welcome-email.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function WelcomeEmail({
+export function WelcomeEmail({
name = "Brendon Urie",
email = "[email protected]",
}: {
diff --git a/apps/web/emails/workspace-invite.tsx b/packages/email/src/templates/workspace-invite.tsx
similarity index 97%
rename from apps/web/emails/workspace-invite.tsx
rename to packages/email/src/templates/workspace-invite.tsx
index 1647813a60..49954f80a1 100644
--- a/apps/web/emails/workspace-invite.tsx
+++ b/packages/email/src/templates/workspace-invite.tsx
@@ -12,9 +12,9 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import Footer from "./components/footer";
+import { Footer } from "../components/footer";
-export default function WorkspaceInvite({
+export function WorkspaceInvite({
email = "[email protected]",
appName = "Dub.co",
url = "http://localhost:8888/api/auth/callback/email?callbackUrl=http%3A%2F%2Fapp.localhost%3A3000%2Flogin&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&[email protected]",
diff --git a/packages/email/src/types.ts b/packages/email/src/types.ts
new file mode 100644
index 0000000000..e9992822fd
--- /dev/null
+++ b/packages/email/src/types.ts
@@ -0,0 +1,8 @@
+export type WorkspaceProps = {
+ id: string;
+ name: string;
+ slug: string;
+ usage: number;
+ usageLimit: number;
+ plan: string;
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d7b0dd1f16..841b084bba 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -494,6 +494,9 @@ importers:
'@react-email/components':
specifier: ^0.0.22
+ lucide-react:
+ specifier: ^0.462.0
+ version: 0.462.0([email protected])
react:
specifier: ^18.2.0
version: 18.2.0
@@ -503,6 +506,9 @@ importers:
react-email:
specifier: ^2.1.6
version: 2.1.6(@opentelemetry/[email protected])([email protected])
+ resend:
+ specifier: ^4.0.0
devDependencies:
'@types/react':
specifier: ^18.2.48