fix(pitch-deck): split email.ts to fix client bundle including nodemailer
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m40s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 45s
CI / test-python-voice (push) Successful in 31s
CI / test-bqas (push) Successful in 43s
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m40s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 45s
CI / test-python-voice (push) Successful in 31s
CI / test-bqas (push) Successful in 43s
Client component (investors/new page) imported DEFAULT_MESSAGE etc. from lib/email.ts which also top-level initialises nodemailer — webpack tried to bundle fs/net/dns into the client chunk and failed. Extract the pure constants + getDefaultGreeting into lib/email-templates.ts (client-safe), keep nodemailer in lib/email.ts (server-only), update the page to import from email-templates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { useState, useMemo } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import Link from 'next/link'
|
||||
import { ArrowLeft, Eye, Send } from 'lucide-react'
|
||||
import { DEFAULT_MESSAGE, DEFAULT_CLOSING, getDefaultGreeting } from '@/lib/email'
|
||||
import { DEFAULT_MESSAGE, DEFAULT_CLOSING, getDefaultGreeting } from '@/lib/email-templates'
|
||||
|
||||
export default function NewInvestorPage() {
|
||||
const router = useRouter()
|
||||
|
||||
9
pitch-deck/lib/email-templates.ts
Normal file
9
pitch-deck/lib/email-templates.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const DEFAULT_GREETING = 'Sehr geehrte Damen und Herren'
|
||||
export const DEFAULT_MESSAGE =
|
||||
'wir freuen uns, Ihnen einen exklusiven Zugang zu unserem interaktiven Investor Pitch Deck zu gewähren. Die Präsentation enthält alle relevanten Informationen zu unserem Unternehmen, unserem Produkt und unserer Finanzierungsstrategie.'
|
||||
export const DEFAULT_CLOSING =
|
||||
'Mit freundlichen Grüßen,\nBenjamin Boenisch & Sharang Parnerkar\nGründer — BreakPilot ComplAI'
|
||||
|
||||
export function getDefaultGreeting(name: string | null): string {
|
||||
return name ? `Sehr geehrte(r) ${name}` : DEFAULT_GREETING
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
import 'server-only'
|
||||
import nodemailer from 'nodemailer'
|
||||
import {
|
||||
DEFAULT_MESSAGE,
|
||||
DEFAULT_CLOSING,
|
||||
getDefaultGreeting,
|
||||
} from '@/lib/email-templates'
|
||||
|
||||
export { DEFAULT_GREETING, DEFAULT_MESSAGE, DEFAULT_CLOSING, getDefaultGreeting } from '@/lib/email-templates'
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
host: process.env.SMTP_HOST,
|
||||
@@ -13,16 +21,6 @@ const transporter = nodemailer.createTransport({
|
||||
const fromName = process.env.SMTP_FROM_NAME || 'BreakPilot'
|
||||
const fromAddr = process.env.SMTP_FROM_ADDR || 'noreply@breakpilot.ai'
|
||||
|
||||
export const DEFAULT_GREETING = 'Sehr geehrte Damen und Herren'
|
||||
export const DEFAULT_MESSAGE =
|
||||
'wir freuen uns, Ihnen einen exklusiven Zugang zu unserem interaktiven Investor Pitch Deck zu gewähren. Die Präsentation enthält alle relevanten Informationen zu unserem Unternehmen, unserem Produkt und unserer Finanzierungsstrategie.'
|
||||
export const DEFAULT_CLOSING =
|
||||
'Mit freundlichen Grüßen,\nBenjamin Boenisch & Sharang Parnerkar\nGründer — BreakPilot ComplAI'
|
||||
|
||||
export function getDefaultGreeting(name: string | null): string {
|
||||
return name ? `Sehr geehrte(r) ${name}` : DEFAULT_GREETING
|
||||
}
|
||||
|
||||
export async function sendMagicLinkEmail(
|
||||
to: string,
|
||||
investorName: string | null,
|
||||
|
||||
9
pitch-deck/package-lock.json
generated
9
pitch-deck/package-lock.json
generated
@@ -17,7 +17,8 @@
|
||||
"pg": "^8.13.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"recharts": "^2.15.0"
|
||||
"recharts": "^2.15.0",
|
||||
"server-only": "^0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
@@ -3743,6 +3744,12 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/server-only": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz",
|
||||
"integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sharp": {
|
||||
"version": "0.34.5",
|
||||
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
"pg": "^8.13.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"recharts": "^2.15.0"
|
||||
"recharts": "^2.15.0",
|
||||
"server-only": "^0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
|
||||
Reference in New Issue
Block a user