diff --git a/pitch-deck/app/api/admin/invite/route.ts b/pitch-deck/app/api/admin/invite/route.ts
index 602026e..c5aefe1 100644
--- a/pitch-deck/app/api/admin/invite/route.ts
+++ b/pitch-deck/app/api/admin/invite/route.ts
@@ -11,7 +11,7 @@ export async function POST(request: NextRequest) {
const adminId = guard.kind === 'admin' ? guard.admin.id : null
const body = await request.json().catch(() => ({}))
- const { email, name, company } = body
+ const { email, name, company, greeting, message, closing } = body
if (!email || typeof email !== 'string') {
return NextResponse.json({ error: 'Email required' }, { status: 400 })
@@ -54,7 +54,7 @@ export async function POST(request: NextRequest) {
const baseUrl = process.env.PITCH_BASE_URL || 'https://pitch.breakpilot.ai'
const magicLinkUrl = `${baseUrl}/auth/verify?token=${token}`
- await sendMagicLinkEmail(normalizedEmail, name || null, magicLinkUrl)
+ await sendMagicLinkEmail(normalizedEmail, name || null, magicLinkUrl, greeting, message, closing)
await logAdminAudit(
adminId,
diff --git a/pitch-deck/app/pitch-admin/(authed)/investors/new/page.tsx b/pitch-deck/app/pitch-admin/(authed)/investors/new/page.tsx
index f7cd285..be74368 100644
--- a/pitch-deck/app/pitch-admin/(authed)/investors/new/page.tsx
+++ b/pitch-deck/app/pitch-admin/(authed)/investors/new/page.tsx
@@ -1,18 +1,25 @@
'use client'
-import { useState } from 'react'
+import { useState, useMemo } from 'react'
import { useRouter } from 'next/navigation'
import Link from 'next/link'
-import { ArrowLeft } from 'lucide-react'
+import { ArrowLeft, Eye, Send } from 'lucide-react'
+import { DEFAULT_MESSAGE, DEFAULT_CLOSING, getDefaultGreeting } from '@/lib/email'
export default function NewInvestorPage() {
const router = useRouter()
const [email, setEmail] = useState('')
const [name, setName] = useState('')
const [company, setCompany] = useState('')
+ const [greeting, setGreeting] = useState('')
+ const [message, setMessage] = useState(DEFAULT_MESSAGE)
+ const [closing, setClosing] = useState(DEFAULT_CLOSING)
const [error, setError] = useState('')
const [submitting, setSubmitting] = useState(false)
+ const effectiveGreeting = greeting || getDefaultGreeting(name || null)
+ const ttl = process.env.NEXT_PUBLIC_MAGIC_LINK_TTL_HOURS || '72'
+
async function handleSubmit(e: React.FormEvent) {
e.preventDefault()
setError('')
@@ -21,7 +28,14 @@ export default function NewInvestorPage() {
const res = await fetch('/api/admin/invite', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ email, name, company }),
+ body: JSON.stringify({
+ email,
+ name,
+ company,
+ greeting: effectiveGreeting,
+ message,
+ closing,
+ }),
})
if (res.ok) {
router.push('/pitch-admin/investors')
@@ -37,8 +51,10 @@ export default function NewInvestorPage() {
}
}
+ const closingHtml = useMemo(() => closing.replace(/\n/g, '
'), [closing])
+
return (
-
- A magic link will be emailed. Single-use, expires in {process.env.NEXT_PUBLIC_MAGIC_LINK_TTL_HOURS || '72'}h. + Der Investor erhaelt eine Email mit einem persoenlichen Magic Link (einmalig, verfaellt nach {ttl}h).
-