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.

missed a few spots

Kiran Ke63c73130646
diff --git a/apps/web/app/api/dub/webhook/lead-created.ts b/apps/web/app/api/dub/webhook/lead-created.ts
index 549adbe7a9..a72bd714b6 100644
--- a/apps/web/app/api/dub/webhook/lead-created.ts
+++ b/apps/web/app/api/dub/webhook/lead-created.ts
@@ -1,8 +1,8 @@
import { REFERRAL_SIGNUPS_MAX } from "@/lib/embed/constants";
+import { sendEmailViaResend } from "@dub/email/send-via-resend";
import { NewReferralSignup } from "@dub/email/templates/new-referral-signup";
import { prisma } from "@dub/prisma";
import { LeadCreatedEvent } from "dub/models/components";
-import { sendEmailViaResend } from "emails/send-via-resend";
export async function leadCreated(data: LeadCreatedEvent["data"]) {
const { link: referralLink } = data;
diff --git a/apps/web/lib/api/partners/notify-partner-sale.ts b/apps/web/lib/api/partners/notify-partner-sale.ts
index 4add704276..249d9f8ebe 100644
--- a/apps/web/lib/api/partners/notify-partner-sale.ts
+++ b/apps/web/lib/api/partners/notify-partner-sale.ts
@@ -1,7 +1,7 @@
import { limiter } from "@/lib/cron/limiter";
+import { sendEmailViaResend } from "@dub/email/send-via-resend";
import { NewSaleCreated } from "@dub/email/templates/new-sale-created";
import { prismaEdge } from "@dub/prisma/edge";
-import { sendEmailViaResend } from "emails/send-via-resend";
export async function notifyPartnerSale({
partner,
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index 8efe241853..24e980a1e2 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -15,11 +15,7 @@ module.exports = withAxiom({
reactStrictMode: false,
transpilePackages: ["shiki", "@dub/prisma", "@dub/email"],
experimental: {
- serverComponentsExternalPackages: [
- "@react-email/components",
- "@react-email/render",
- "@react-email/tailwind",
- ],
+ serverComponentsExternalPackages: ["@react-email/tailwind"],
},
webpack: (config, { webpack, isServer }) => {
if (isServer) {
diff --git a/apps/web/package.json b/apps/web/package.json
index eeedda23c6..a52c8432ef 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -3,7 +3,7 @@
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
- "dev": "concurrently --kill-others \"pnpm prisma:generate && next dev --turbo --port 8888\" \"pnpm prisma:generate && pnpm prisma:studio --browser none\" \"email dev --port 3333\"",
+ "dev": "concurrently --kill-others \"pnpm prisma:generate && next dev --turbo --port 8888\" \"pnpm prisma:generate && pnpm prisma:studio --browser none\"",
"build": "pnpm prisma:generate && next build",
"lint": "next lint",
"start": "next start",
@@ -33,7 +33,6 @@
"@prisma/client": "5.18.0",
"@prisma/nextjs-monorepo-workaround-plugin": "^6.0.1",
"@radix-ui/react-hover-card": "^1.1.1",
- "@react-email/components": "^0.0.22",
"@sindresorhus/slugify": "^2.2.1",
"@splinetool/react-spline": "^2.2.6",
"@splinetool/runtime": "^1.2.8",
@@ -84,7 +83,6 @@
"next-plausible": "^3.12.0",
"next-safe-action": "7.9.9",
"node-html-parser": "^6.1.4",
- "nodemailer": "^6.9.3",
"openapi-types": "^12.1.3",
"openapi3-ts": "^4.2.1",
"posthog-js": "^1.164.1",
@@ -92,7 +90,6 @@
"react-colorful": "^5.6.1",
"react-dom": "^18.2.0",
"react-dom-confetti": "^0.2.0",
- "react-email": "^2.1.6",
"react-highlight-words": "^0.20.0",
"react-hook-form": "^7.52.1",
"react-markdown": "^9.0.1",
diff --git a/apps/web/ui/analytics/feedback/action.ts b/apps/web/ui/analytics/feedback/action.ts
index 6721c4416c..4966567c2b 100644
--- a/apps/web/ui/analytics/feedback/action.ts
+++ b/apps/web/ui/analytics/feedback/action.ts
@@ -1,6 +1,6 @@
"use server";
-import { resend } from "@/lib/resend";
+import { resend } from "@dub/email/resend";
import { FeedbackEmail } from "@dub/email/templates/feedback-email";
export async function submitFeedback(data: FormData) {
diff --git a/packages/email/package.json b/packages/email/package.json
index 04b9d7064c..428a374fe9 100644
--- a/packages/email/package.json
+++ b/packages/email/package.json
@@ -32,8 +32,17 @@
"./templates/*": {
"import": "./src/templates/*.tsx"
},
+ "./resend": {
+ "import": "./src/resend/index.ts"
+ },
"./resend/*": {
"import": "./src/resend/*.ts"
+ },
+ "./send-via-nodemailer": {
+ "import": "./src/send-via-nodemailer.ts"
+ },
+ "./send-via-resend": {
+ "import": "./src/send-via-resend.ts"
}
}
}
diff --git a/packages/email/src/index.ts b/packages/email/src/index.ts
index 3082261609..eb4e0cecec 100644
--- a/packages/email/src/index.ts
+++ b/packages/email/src/index.ts
@@ -1,7 +1,7 @@
import { CreateEmailOptions } from "resend";
import { resend } from "./resend";
import { sendViaNodeMailer } from "./send-via-nodemailer";
-import { sendViaResend } from "./send-via-resend";
+import { sendEmailViaResend } from "./send-via-resend";
export const sendEmail = async ({
email,
@@ -20,7 +20,7 @@ export const sendEmail = async ({
marketing?: boolean;
}) => {
if (resend) {
- return await sendViaResend({
+ return await sendEmailViaResend({
email,
subject,
from,
diff --git a/packages/email/src/send-via-resend.ts b/packages/email/src/send-via-resend.ts
index dc50816b43..91ab9b07b4 100644
--- a/packages/email/src/send-via-resend.ts
+++ b/packages/email/src/send-via-resend.ts
@@ -2,7 +2,7 @@ import { CreateEmailOptions } from "resend";
import { resend } from "./resend";
// Send email using Resend (Recommended for production)
-export const sendViaResend = async ({
+export const sendEmailViaResend = async ({
email,
subject,
from,
diff --git a/packages/email/src/templates/failed-payment.tsx b/packages/email/src/templates/failed-payment.tsx
index ce9058d14c..46310b9616 100644
--- a/packages/email/src/templates/failed-payment.tsx
+++ b/packages/email/src/templates/failed-payment.tsx
@@ -1,4 +1,3 @@
-import { Project } from "@dub/prisma/client";
import { DUB_WORDMARK } from "@dub/utils";
import {
Body,
@@ -14,6 +13,7 @@ import {
Text,
} from "@react-email/components";
import { Footer } from "../components/footer";
+import { WorkspaceProps } from "../types";
export function FailedPayment({
user = { name: "Brendon Urie", email: "[email protected]" },
@@ -22,7 +22,7 @@ export function FailedPayment({
attemptCount = 2,
}: {
user: { name?: string | null; email: string };
- workspace: Pick<Project, "name" | "slug">;
+ workspace: Pick<WorkspaceProps, "name" | "slug">;
amountDue: number;
attemptCount: number;
}) {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1fec0624ba..0f67bdde2b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -90,9 +90,6 @@ importers:
'@radix-ui/react-hover-card':
specifier: ^1.1.1
- '@react-email/components':
- specifier: ^0.0.22
'@sindresorhus/slugify':
specifier: ^2.2.1
version: 2.2.1
@@ -230,7 +227,7 @@ importers:
version: 14.3.0-canary.42(@babel/[email protected])(@opentelemetry/[email protected])([email protected])([email protected])
next-auth:
specifier: ^4.24.4
next-axiom:
specifier: ^1.6.0
@@ -243,9 +240,6 @@ importers:
node-html-parser:
specifier: ^6.1.4
version: 6.1.4
- nodemailer:
- specifier: ^6.9.3
- version: 6.9.3
openapi-types:
specifier: ^12.1.3
version: 12.1.3
@@ -267,9 +261,6 @@ importers:
react-dom-confetti:
specifier: ^0.2.0
version: 0.2.0([email protected])
- react-email:
- specifier: ^2.1.6
- version: 2.1.6(@opentelemetry/[email protected])([email protected])
react-highlight-words:
specifier: ^0.20.0
version: 0.20.0([email protected])
@@ -508,7 +499,7 @@ importers:
version: 18.2.0([email protected])
react-email:
specifier: ^2.1.6
- version: 2.1.6(@opentelemetry/[email protected])([email protected])
+ version: 2.1.6([email protected])
resend:
specifier: ^4.0.0
@@ -4913,7 +4904,7 @@ packages:
next-auth: ^4
dependencies:
'@prisma/client': 5.18.0([email protected])
dev: false
@@ -17329,7 +17320,7 @@ packages:
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
dev: false
resolution: {integrity: sha512-5DGffi+OpkbU62vPQIJ1z+hFnmow+ec5Qrn9m6eoglIO51m0DlrmLxBduZEwKAYDEg9k2joi1yelgmq1vqK3aQ==}
peerDependencies:
next: ^12.2.5 || ^13 || ^14
@@ -17345,7 +17336,6 @@ packages:
cookie: 0.5.0
jose: 4.15.4
next: 14.3.0-canary.42(@babel/[email protected])(@opentelemetry/[email protected])([email protected])([email protected])
- nodemailer: 6.9.3
oauth: 0.9.15
openid-client: 5.6.1
preact: 10.18.1
@@ -17407,7 +17397,7 @@ packages:
zod: 3.22.4
dev: false
resolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==}
engines: {node: '>=18.17.0'}
hasBin: true
@@ -17423,7 +17413,6 @@ packages:
optional: true
dependencies:
'@next/env': 14.1.4
- '@opentelemetry/api': 1.8.0
'@swc/helpers': 0.5.2
busboy: 1.6.0
caniuse-lite: 1.0.30001651
@@ -18693,7 +18682,7 @@ packages:
react: 18.2.0
scheduler: 0.23.0
resolution: {integrity: sha512-BtR9VI1CMq4953wfiBmzupKlWcRThaWG2dDgl1vWAllK3tNNmJNerwY4VlmASRDQZE3LpLXU3+lf8N/VAKdbZQ==}
engines: {node: '>=18.0.0'}
hasBin: true
@@ -18723,7 +18712,7 @@ packages:
glob: 10.3.4
log-symbols: 4.1.0
mime-types: 2.1.35
normalize-path: 3.0.0
ora: 5.4.1
postcss: 8.4.38