Scheduling infrastructure for absolutely everyone.
Feature/whitelabel part 2 (#5821)
René Müller27d9fad292c3
diff --git a/apps/web/pages/auth/verify.tsx b/apps/web/pages/auth/verify.tsxindex e4ee54f77ea..0488aa360d3 100644--- a/apps/web/pages/auth/verify.tsx+++ b/apps/web/pages/auth/verify.tsx@@ -6,7 +6,7 @@ import * as React from "react";import { useEffect, useState, useRef } from "react";import z from "zod";-import { WEBAPP_URL } from "@calcom/lib/constants";+import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants";import { trpc } from "@calcom/trpc/react";import { Button, showToast } from "@calcom/ui";@@ -110,7 +110,7 @@ export default function Verify() {? "Your payment failed": sessionId? "Payment successful!"- : "Verify your email" + " | Cal.com"}+ : "Verify your email" + " | " + APP_NAME}</title></Head><div className="flex min-h-screen flex-col items-center justify-center px-6">diff --git a/apps/web/pages/video/[uid].tsx b/apps/web/pages/video/[uid].tsxindex b622a6f6750..773fa809011 100644--- a/apps/web/pages/video/[uid].tsx+++ b/apps/web/pages/video/[uid].tsx@@ -4,7 +4,7 @@ import { getSession } from "next-auth/react";import Head from "next/head";import { useEffect } from "react";-import { SEO_IMG_OGIMG_VIDEO, WEBSITE_URL } from "@calcom/lib/constants";+import { APP_NAME, SEO_IMG_OGIMG_VIDEO, WEBSITE_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";import prisma, { bookingMinimalSelect } from "@calcom/prisma";import { inferSSRProps } from "@calcom/types/inferSSRProps";@@ -48,18 +48,18 @@ export default function JoinCall(props: JoinCallPageProps) {return (<><Head>- <title>Cal.com Video</title>- <meta name="title" content="Cal.com Video" />+ <title>{APP_NAME} Video</title>+ <meta name="title" content={APP_NAME + " Video"} /><meta name="description" content={t("quick_video_meeting")} /><meta property="og:image" content={SEO_IMG_OGIMG_VIDEO} /><meta property="og:type" content="website" /><meta property="og:url" content={`${WEBSITE_URL}/video`} />- <meta property="og:title" content="Cal.com Video" />+ <meta property="og:title" content={APP_NAME + " Video"} /><meta property="og:description" content={t("quick_video_meeting")} /><meta property="twitter:image" content={SEO_IMG_OGIMG_VIDEO} /><meta property="twitter:card" content="summary_large_image" /><meta property="twitter:url" content={`${WEBSITE_URL}/video`} />- <meta property="twitter:title" content="Cal.com Video" />+ <meta property="twitter:title" content={APP_NAME + " Video"} /><meta property="twitter:description" content={t("quick_video_meeting")} /></Head><div style={{ zIndex: 2, position: "relative" }}>diff --git a/apps/web/public/static/locales/de/common.json b/apps/web/public/static/locales/de/common.jsonindex 03534ba3072..67f71b10549 100644--- a/apps/web/public/static/locales/de/common.json+++ b/apps/web/public/static/locales/de/common.json@@ -109,7 +109,7 @@"upgrade_to_per_seat": "Upgrade auf Pro-Mitglied lizensierung","team_upgrade_seats_details": "Von den {{memberCount}} Mitgliedern in Ihrem Team sind {{unpaidCount}} Sitze(n) unbezahlt. Bei ${{seatPrice}}/m pro Sitzplatz betragen die geschätzten Gesamtkosten Ihrer Mitgliedschaft ${{totalCost}}/m.","team_upgrade_banner_description": "Vielen Dank, dass Sie unseren neuen Teamplan getestet haben. Wir haben festgestellt, dass Ihr Team „{{teamName}}“ aktualisiert werden muss.",- "team_upgrade_banner_action": "Hier aufrüsten",+ "team_upgrade_banner_action": "Klicke zum aktualisiert","team_upgraded_successfully": "Das Update für Ihr Team war erfolgreich!","use_link_to_reset_password": "Benutzen Sie den Link, um Ihr Passwort zurückzusetzen","hey_there": "Hallo,",diff --git a/packages/emails/templates/attendee-request-email.ts b/packages/emails/templates/attendee-request-email.tsindex b4f10f96879..3b77853f71d 100644--- a/packages/emails/templates/attendee-request-email.ts+++ b/packages/emails/templates/attendee-request-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import AttendeeScheduledEmail from "./attendee-scheduled-email";@@ -14,7 +16,7 @@ export default class AttendeeRequestEmail extends AttendeeScheduledEmail {}return {- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.calEvent.attendees[0].language.translate("booking_submitted_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts b/packages/emails/templates/attendee-was-requested-to-reschedule-email.tsindex f8366c6d4eb..cfeb6c3d66e 100644--- a/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts+++ b/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts@@ -2,6 +2,7 @@ import { createEvent, DateArray, Person } from "ics";import dayjs from "@calcom/dayjs";import { getManageLink } from "@calcom/lib/CalEventParser";+import { APP_NAME } from "@calcom/lib/constants";import type { CalendarEvent } from "@calcom/types/Calendar";import { renderEmail } from "..";@@ -21,7 +22,7 @@ export default class AttendeeWasRequestedToRescheduleEmail extends OrganizerSchefilename: "event.ics",content: this.getiCalEventAsString(),},- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("requested_to_reschedule_subject_attendee", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-cancelled-email.ts b/packages/emails/templates/organizer-cancelled-email.tsindex ef132374020..c7a3be2cbef 100644--- a/packages/emails/templates/organizer-cancelled-email.ts+++ b/packages/emails/templates/organizer-cancelled-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -14,7 +16,7 @@ export default class OrganizerCancelledEmail extends OrganizerScheduledEmail {}return {- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("event_cancelled_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-location-change-email.ts b/packages/emails/templates/organizer-location-change-email.tsindex 043b85630b8..1385d10609e 100644--- a/packages/emails/templates/organizer-location-change-email.ts+++ b/packages/emails/templates/organizer-location-change-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -18,7 +20,7 @@ export default class OrganizerLocationChangeEmail extends OrganizerScheduledEmaifilename: "event.ics",content: this.getiCalEventAsString(),},- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("location_changed_event_type_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-payment-refund-failed-email.ts b/packages/emails/templates/organizer-payment-refund-failed-email.tsindex 59142da7710..1567501f35c 100644--- a/packages/emails/templates/organizer-payment-refund-failed-email.ts+++ b/packages/emails/templates/organizer-payment-refund-failed-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -14,7 +16,7 @@ export default class OrganizerPaymentRefundFailedEmail extends OrganizerSchedule}return {- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("refund_failed_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-request-email.ts b/packages/emails/templates/organizer-request-email.tsindex f8ff9981787..11925937e1b 100644--- a/packages/emails/templates/organizer-request-email.ts+++ b/packages/emails/templates/organizer-request-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -14,7 +16,7 @@ export default class OrganizerRequestEmail extends OrganizerScheduledEmail {}return {- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("event_awaiting_approval_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-request-reminder-email.ts b/packages/emails/templates/organizer-request-reminder-email.tsindex d87ed752c19..61e7c782b27 100644--- a/packages/emails/templates/organizer-request-reminder-email.ts+++ b/packages/emails/templates/organizer-request-reminder-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import OrganizerRequestEmail from "./organizer-request-email";@@ -14,7 +16,7 @@ export default class OrganizerRequestReminderEmail extends OrganizerRequestEmail}return {- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("event_awaiting_approval_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-requested-to-reschedule-email.ts b/packages/emails/templates/organizer-requested-to-reschedule-email.tsindex 5abdf1ebc9a..e3c433f0146 100644--- a/packages/emails/templates/organizer-requested-to-reschedule-email.ts+++ b/packages/emails/templates/organizer-requested-to-reschedule-email.ts@@ -2,6 +2,7 @@ import { createEvent, DateArray, Person } from "ics";import dayjs from "@calcom/dayjs";import { getRichDescription } from "@calcom/lib/CalEventParser";+import { APP_NAME } from "@calcom/lib/constants";import type { CalendarEvent } from "@calcom/types/Calendar";import { renderEmail } from "..";@@ -21,7 +22,7 @@ export default class OrganizerRequestedToRescheduleEmail extends OrganizerSchedufilename: "event.ics",content: this.getiCalEventAsString(),},- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("rescheduled_event_type_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-rescheduled-email.ts b/packages/emails/templates/organizer-rescheduled-email.tsindex d48d12e58be..c38a70fc91d 100644--- a/packages/emails/templates/organizer-rescheduled-email.ts+++ b/packages/emails/templates/organizer-rescheduled-email.ts@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -18,7 +20,7 @@ export default class OrganizerRescheduledEmail extends OrganizerScheduledEmail {filename: "event.ics",content: this.getiCalEventAsString(),},- from: `Cal.com <${this.getMailerOptions().from}>`,+ from: `${APP_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.calEvent.organizer.language.translate("event_type_has_been_rescheduled_on_time_date", {eventType: this.calEvent.type,diff --git a/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts b/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.tsindex 97371a798f6..0e501306ce1 100644--- a/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts+++ b/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts@@ -1,4 +1,5 @@import dayjs from "@calcom/dayjs";+import { APP_NAME } from "@calcom/lib/constants";const emailReminderTemplate = (startTime: string,@@ -32,7 +33,7 @@ const emailReminderTemplate = (const attendeeHtml = `<div style="font-weight: bold;">Attendees:</div>You & ${attendee}<br><br>`;- const endingHtml = `This reminder was triggered by a Workflow in Cal.<br><br>_<br><br>Scheduling by Cal.com</body>`;+ const endingHtml = `This reminder was triggered by a Workflow in Cal.<br><br>_<br><br>Scheduling by ${APP_NAME}</body>`;const templateBodyHtml = introHtml + eventHtml + dateTimeHtml + attendeeHtml + endingHtml;diff --git a/packages/features/tips/Tips.tsx b/packages/features/tips/Tips.tsxindex 2b48487afec..8a7c99fadc0 100644--- a/packages/features/tips/Tips.tsx+++ b/packages/features/tips/Tips.tsx@@ -1,6 +1,7 @@import { useAutoAnimate } from "@formkit/auto-animate/react";import { useEffect, useState } from "react";+import { APP_NAME } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";import { localStorage } from "@calcom/lib/webstorage";import { Card } from "@calcom/ui";@@ -43,7 +44,7 @@ export const tips = [thumbnailUrl: "https://img.youtube.com/vi/0v_nQtpxC_4/0.jpg",mediaLink: "https://go.cal.com/payments-video",title: "Accept Payments",- description: "Charge for your time with Cal.com's Stripe App",+ description: "Charge for your time with " + APP_NAME + "'s Stripe App",href: "https://app.cal.com/apps/stripe",},{diff --git a/packages/features/users/components/UserV2OptInBanner.tsx b/packages/features/users/components/UserV2OptInBanner.tsxindex 238527858f2..871afb6cab4 100644--- a/packages/features/users/components/UserV2OptInBanner.tsx+++ b/packages/features/users/components/UserV2OptInBanner.tsx@@ -1,3 +1,5 @@+import { APP_NAME } from "@calcom/lib/constants";+function UserV2OptInBanner() {// Only show on client-sideif (typeof document === "undefined") return null;@@ -7,7 +9,7 @@ function UserV2OptInBanner() {if (hasV2OptInCookie)return (<p className="text-xs text-gray-400">- You're using the new version of Cal.com.{" "}+ You're using the new version of {APP_NAME}.{" "}<a href="/api/v2-opt-in" className="text-blue-400 underline">Go back</a>@@ -17,7 +19,7 @@ function UserV2OptInBanner() {return (<p className="text-xs text-gray-400">- Want to try the new version of Cal.com?{" "}+ Want to try the new version of {APP_NAME}?{" "}<a href="/api/v2-opt-in" className="text-blue-400 underline">Opt-in to our v2.0 beta</a>diff --git a/packages/lib/CloseComeUtils.ts b/packages/lib/CloseComeUtils.tsindex 386f8528837..5e06113dbd1 100644--- a/packages/lib/CloseComeUtils.ts+++ b/packages/lib/CloseComeUtils.ts@@ -7,6 +7,7 @@ import CloseCom, {CloseComFieldOptions,CloseComLead,} from "./CloseCom";+import { APP_NAME } from "./constants";export async function getCloseComContactIds(persons: { email: string; name: string | null }[],@@ -150,7 +151,7 @@ export async function getCloseComCustomActivityTypeFieldsIds() {// Check if Custom Activity Type existsconst customActivities = await closeCom.customActivity.type.get();- const calComCustomActivity = customActivities.data.filter((act) => act.name === "Cal.com Activity");+ const calComCustomActivity = customActivities.data.filter((act) => act.name === `${APP_NAME} Activity`);if (calComCustomActivity.length > 0) {// Cal.com Custom Activity type exist// Get Custom Activity Type fields ids@@ -163,8 +164,8 @@ export async function getCloseComCustomActivityTypeFieldsIds(// Cal.com Custom Activity type doesn't exist// Create Custom Activity Typeconst { id: activityType } = await closeCom.customActivity.type.create({- name: "Cal.com Activity",- description: "Bookings in your Cal.com account",+ name: APP_NAME + " Activity",+ description: "Bookings in your " + APP_NAME + " account",});// Create Custom Activity Fieldsconst fields = await Promise.all(@@ -190,8 +191,8 @@ export async function getCloseComCustomActivityTypeFieldsIds(export async function getCloseComLeadId(closeCom: CloseCom,leadInfo: CloseComLead = {- companyName: "From Cal.com",- description: "Generic Lead for Contacts created by Cal.com",+ companyName: "From " + APP_NAME,+ description: "Generic Lead for Contacts created by " + APP_NAME,}): Promise<string> {const closeComLeadNames = await closeCom.lead.list({ query: { _fields: ["name", "id"] } });diff --git a/packages/lib/constants.ts b/packages/lib/constants.tsindex cc1c2a9253f..46a0c549492 100644--- a/packages/lib/constants.ts+++ b/packages/lib/constants.ts@@ -1,11 +1,12 @@-/* TODO: Get this from endpoint */-import pkg from "@calcom/web/package.json";-const VERCEL_URL = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "";const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.env.RAILWAY_STATIC_URL}` : "";const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : "";export const WEBAPP_URL =- process.env.NEXT_PUBLIC_WEBAPP_URL || VERCEL_URL || RAILWAY_STATIC_URL || HEROKU_URL;+ process.env.NEXT_PUBLIC_WEBAPP_URL ||+ VERCEL_URL ||+ RAILWAY_STATIC_URL ||+ HEROKU_URL ||+ "http://localhost:3000";/** @deprecated use `WEBAPP_URL` */export const BASE_URL = WEBAPP_URL;export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";diff --git a/packages/ui/v2/core/Meta.tsx b/packages/ui/v2/core/Meta.tsxindex 1a7b513f227..2f143b8384e 100644--- a/packages/ui/v2/core/Meta.tsx+++ b/packages/ui/v2/core/Meta.tsx@@ -1,6 +1,8 @@import Head from "next/head";import React, { createContext, useContext, useState, useEffect } from "react";+import { APP_NAME } from "@calcom/lib/constants";+type MetaType = {title: string;description: string;@@ -54,7 +56,9 @@ export default function Meta({ title, description, backButton, CTA }: MetaType)return (<Head>- <title>{title} | Cal.com</title>+ <title>+ {title} | {APP_NAME}+ </title><meta name="description" content={description} /></Head>);diff --git a/packages/ui/v2/core/head-seo.tsx b/packages/ui/v2/core/head-seo.tsxindex efe1a2e4be3..2819017c787 100644--- a/packages/ui/v2/core/head-seo.tsx+++ b/packages/ui/v2/core/head-seo.tsx@@ -3,6 +3,7 @@ import { NextSeo, NextSeoProps } from "next-seo";import { constructAppImage, constructGenericImage, constructMeetingImage } from "@calcom/lib/OgImages";import { getBrowserInfo } from "@calcom/lib/browser/browser.utils";+import { APP_NAME } from "@calcom/lib/constants";import { seoConfig, getSeoImage, HeadSeoProps } from "@calcom/lib/next-seo.config";import { truncateOnWord } from "@calcom/lib/text";@@ -61,7 +62,7 @@ export const HeadSeo = (props: HeadSeoProps): JSX.Element => {const image = getSeoImage("ogImage") + constructGenericImage({ title, description });const truncatedDescription = truncateOnWord(description, 158);- const pageTitle = title + " | Cal.com";+ const pageTitle = title + " | " + APP_NAME;let seoObject = buildSeoMeta({title: pageTitle,image,