The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Revert "setup mailhog"
Kiran Kf9571dea6914
diff --git a/apps/web/.env.example b/apps/web/.env.exampleindex 6b1f002b56..a83a428b55 100644--- a/apps/web/.env.example+++ b/apps/web/.env.example@@ -43,13 +43,6 @@ NEXTAUTH_URL=http://localhost:8888 # (only needed for localhost)# Get your Resend API Key here: https://resend.com/api-keysRESEND_API_KEY=-# SMTP configuration (Recommended for local development)-SMTP_HOST=localhost-SMTP_PORT=1025-SMTP_SECURE_ENABLED=0-SMTP_USER=smtpUser-SMTP_PASSWORD=smtpPassword-##################################### OPTIONAL ENV VARS #####################################diff --git a/apps/web/docker-compose.yml b/apps/web/docker-compose.ymlindex 1aeca3974d..79c187d9ee 100644--- a/apps/web/docker-compose.yml+++ b/apps/web/docker-compose.yml@@ -1,6 +1,5 @@# This is meant for local development only. Do not use this in production.version: "3.8"-services:ps-mysql:image: mysql:8.0@@ -18,7 +17,6 @@ services:- 3306:3306volumes:- ps-mysql:/var/lib/mysql-planetscale-proxy:image: ghcr.io/mattrobenolt/ps-http-sim:latestcommand:@@ -34,12 +32,5 @@ services:- 3900:3900links:- ps-mysql-- mailhog:- image: "mailhog/mailhog:latest"- ports:- - "1025:1025"- - "8025:8025"-volumes:- ps-mysql:+ ps-mysql:\ No newline at end of filediff --git a/apps/web/emails/index.ts b/apps/web/emails/index.tsindex 59d223ff8f..d7a90acd88 100644--- a/apps/web/emails/index.ts+++ b/apps/web/emails/index.ts@@ -1,51 +1,6 @@import { resend } from "@/lib/resend";-import { render } from "@react-email/components";-import nodemailer from "nodemailer";-import { ReactElement } from "react";import { CreateEmailOptions } from "resend";-// Send email using SMTP (Recommended for local development)-const sendEmailViaSMTP = async ({- email,- subject,- text,- react,-}: Omit<CreateEmailOptions, "to" | "from"> & {- email: string;-}) => {- const smtpConfigured = Boolean(- process.env.SMTP_HOST && process.env.SMTP_PORT,- );-- if (!smtpConfigured) {- console.info("SMTP is not configured. Skipping sending email.");- return;- }-- 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({- from: "[email protected]",- to: email,- subject,- text,- html: render(react as ReactElement),- });-- console.log("Email sent: %s", info.messageId);-};-export const sendEmail = async ({email,subject,@@ -62,20 +17,12 @@ export const sendEmail = async ({replyToFromEmail?: boolean;marketing?: boolean;}) => {- if (process.env.NODE_ENV === "development") {- return await sendEmailViaSMTP({- email,- subject,- text,- react,- });- }-- if (!resend) {+ if (process.env.NODE_ENV === "development" && !resend) {console.info("RESEND_API_KEY is not set in the .env. Skipping sending email.",);- return;++ return Promise.resolve();}return resend?.emails.send({