Adjusted SMTP
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
getTenantRequestByOrgId,
|
||||
} from "@/lib/db";
|
||||
import { getTenant, listTenants } from "@/lib/k8s";
|
||||
import { sendAdminNotificationEmail } from "@/lib/email";
|
||||
import type { OnboardingInput } from "@/types";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -87,6 +88,7 @@ export async function GET() {
|
||||
* POST /api/onboarding
|
||||
* Submit the onboarding wizard. Creates a tenant_request with status "pending".
|
||||
* The actual PiecedTenant CR is NOT created yet — admin approval required.
|
||||
* Sends a notification email to the admin.
|
||||
*/
|
||||
export async function POST(request: Request) {
|
||||
const user = await getSessionUser();
|
||||
@@ -138,6 +140,13 @@ export async function POST(request: Request) {
|
||||
billingNotes: input.billingNotes,
|
||||
});
|
||||
|
||||
// Notify admin about the new request
|
||||
await sendAdminNotificationEmail(
|
||||
user.orgName,
|
||||
user.name || user.email,
|
||||
user.email
|
||||
);
|
||||
|
||||
return NextResponse.json(
|
||||
{ message: "Onboarding request submitted.", request: tenantRequest },
|
||||
{ status: 201 }
|
||||
|
||||
Reference in New Issue
Block a user