2023-02-16 22:39:57 +00:00
|
|
|
import type { NextApiRequest, NextApiResponse } from "next";
|
2022-06-06 17:49:56 +00:00
|
|
|
|
|
|
|
import { renderEmail } from "@calcom/emails";
|
2023-08-10 16:32:20 +00:00
|
|
|
import { IS_PRODUCTION } from "@calcom/lib/constants";
|
2022-06-06 17:49:56 +00:00
|
|
|
import { getTranslation } from "@calcom/lib/server/i18n";
|
|
|
|
|
|
|
|
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
2023-08-10 16:32:20 +00:00
|
|
|
if (IS_PRODUCTION) return res.write("Only for development purposes"), res.end();
|
2022-06-06 17:49:56 +00:00
|
|
|
const t = await getTranslation("en", "common");
|
2022-06-25 05:16:20 +00:00
|
|
|
const language = { translate: t, locale: "en" };
|
2022-06-06 17:49:56 +00:00
|
|
|
|
|
|
|
const evt = {
|
|
|
|
type: "30min",
|
|
|
|
title: "30min between Pro Example and pro@example.com",
|
|
|
|
description: null,
|
|
|
|
additionalNotes: "asdasdas",
|
|
|
|
startTime: "2022-06-03T09:00:00-06:00",
|
|
|
|
endTime: "2022-06-03T09:30:00-06:00",
|
|
|
|
organizer: {
|
|
|
|
name: "Pro Example",
|
|
|
|
email: "pro@example.com",
|
|
|
|
timeZone: "Europe/London",
|
2022-06-25 05:16:20 +00:00
|
|
|
language,
|
2022-06-06 17:49:56 +00:00
|
|
|
},
|
|
|
|
attendees: [
|
|
|
|
{
|
|
|
|
email: "pro@example.com",
|
|
|
|
name: "pro@example.com",
|
|
|
|
timeZone: "America/Chihuahua",
|
2022-06-25 05:16:20 +00:00
|
|
|
language,
|
2022-06-06 17:49:56 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
location: "Zoom video",
|
|
|
|
destinationCalendar: null,
|
|
|
|
hideCalendarNotes: false,
|
2022-12-13 21:09:28 +00:00
|
|
|
uid: "xxyPr4cg2xx4XoS2KeMEQy",
|
2022-06-06 17:49:56 +00:00
|
|
|
metadata: {},
|
2022-06-10 00:32:34 +00:00
|
|
|
recurringEvent: null,
|
2023-01-10 02:01:57 +00:00
|
|
|
appsStatus: [
|
|
|
|
{
|
|
|
|
appName: "Outlook Calendar",
|
|
|
|
type: "office365_calendar",
|
|
|
|
success: 1,
|
|
|
|
failures: 0,
|
|
|
|
errors: [],
|
|
|
|
warnings: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
appName: "Google Meet",
|
|
|
|
type: "conferencing",
|
|
|
|
success: 0,
|
|
|
|
failures: 1,
|
|
|
|
errors: [],
|
|
|
|
warnings: ["In order to use Google Meet you must set your destination calendar to a Google Calendar"],
|
|
|
|
},
|
|
|
|
],
|
2022-06-06 17:49:56 +00:00
|
|
|
};
|
|
|
|
|
2023-07-24 09:55:51 +00:00
|
|
|
res.statusCode = 200;
|
2022-06-06 17:49:56 +00:00
|
|
|
|
|
|
|
res.setHeader("Content-Type", "text/html");
|
|
|
|
res.setHeader("Cache-Control", "no-cache, no-store, private, must-revalidate");
|
|
|
|
res.write(
|
2023-06-07 07:27:48 +00:00
|
|
|
renderEmail("VerifyAccountEmail", {
|
|
|
|
language: t,
|
|
|
|
user: {
|
|
|
|
name: "Pro Example",
|
|
|
|
email: "pro@example.com",
|
|
|
|
},
|
|
|
|
verificationEmailLink:
|
|
|
|
"http://localhost:3000/api/auth/verify-email?token=b91af0eee5a9a24a8d83a3d3d6a58c1606496e94ced589441649273c66100f5b",
|
2022-06-06 17:49:56 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
res.end();
|
|
|
|
};
|
|
|
|
|
|
|
|
export default handler;
|