fix: hide cal branding for orgs/teams (#27643)

* fix: hide branding for teams

* fix: remove unused organizationId and username fields from profiles select

Addresses Cubic AI review feedback (confidence 9/10) to select only
the profile fields that are actually used. The organizationId and
username fields were fetched but never referenced in this function.

Co-Authored-By: unknown <>

* fix: unit tests

* fix: add prisma named export to test mock

Co-Authored-By: [email protected] <[email protected]>

* Add tests: packages/features/profile/lib/hideBranding.test.ts

Generated by Paragon from proposal for PR #27643

* chore: implement cubic feedback

* fix: merge conflicts

* fix: unit tests

* fixup

* refactor: implement DI pattern for event type service

* fix: atoms build

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-02-25 20:53:01 +09:00
1 parent 4081d11fbe
commit 5d65a0f091
39 files changed
+1129 -154

No files matched your search

+1
View File
@@ -20,4 +20,5 @@ export type EmailVerifyCode = {
};
verificationEmailCode: string;
isVerifyingEmail?: boolean;
hideLogo?: boolean;
};
@@ -1,19 +1,17 @@
import type { TFunction } from "i18next";
import dayjs from "@calcom/dayjs";
import { formatPrice } from "@calcom/lib/currencyConversions";
import { TimeFormat } from "@calcom/lib/timeFormat";
import type { CalendarEvent, Person } from "@calcom/types/Calendar";
import type { TFunction } from "i18next";
import {
AppsStatus,
BaseEmailHtml,
Info,
LocationInfo,
ManageLink,
UserFieldsResponses,
WhenInfo,
WhoInfo,
AppsStatus,
UserFieldsResponses,
} from "../components";
import { PersonInfo } from "../components/WhoInfo";
@@ -65,7 +63,7 @@ export const BaseScheduledEmail = (
return (
<BaseEmailHtml
hideLogo={Boolean(props.calEvent.platformClientId)}
hideLogo={Boolean(props.calEvent.platformClientId) || Boolean(props.calEvent.hideBranding)}
headerType={props.headerType || "checkCircle"}
subject={props.subject || subject}
title={t(
@@ -1,5 +1,8 @@
import { APP_NAME, SENDER_NAME, SUPPORT_MAIL_ADDRESS } from "@calcom/lib/constants";
import {
APP_NAME,
SENDER_NAME,
SUPPORT_MAIL_ADDRESS,
} from "@calcom/lib/constants";
import type { EmailVerifyCode } from "../../lib/types/email-types";
import { BaseEmailHtml } from "../components";
@@ -8,15 +11,23 @@ export const VerifyEmailByCode = (
) => {
return (
<BaseEmailHtml
subject={props.language(`verify_email_subject${props.isVerifyingEmail ? "_verifying_email" : ""}`, {
appName: APP_NAME,
})}>
hideLogo={props.hideLogo}
subject={
props.hideLogo
? props.language("verify_email_subject_no_branding")
: props.language(
`verify_email_subject${props.isVerifyingEmail ? "_verifying_email" : ""}`,
{ appName: APP_NAME }
)
}
>
<p
style={{
fontWeight: 600,
fontSize: "32px",
lineHeight: "38px",
}}>
}}
>
<>{props.language("verify_email_email_header")}</>
</p>
<p style={{ fontWeight: 400 }}>
@@ -31,20 +42,27 @@ export const VerifyEmailByCode = (
</>
</p>
</div>
<div style={{ lineHeight: "6px" }}>
<p style={{ fontWeight: 400, lineHeight: "24px" }}>
<>
{props.language("happy_scheduling")}, <br />
<a
href={`mailto:${SUPPORT_MAIL_ADDRESS}`}
style={{ color: "#3E3E3E" }}
target="_blank"
rel="noreferrer">
<>{props.language("the_calcom_team", { companyName: SENDER_NAME })}</>
</a>
</>
</p>
</div>
{!props.hideLogo && (
<div style={{ lineHeight: "6px" }}>
<p style={{ fontWeight: 400, lineHeight: "24px" }}>
<>
{props.language("happy_scheduling")}, <br />
<a
href={`mailto:${SUPPORT_MAIL_ADDRESS}`}
style={{ color: "#3E3E3E" }}
target="_blank"
rel="noreferrer"
>
<>
{props.language("the_calcom_team", {
companyName: SENDER_NAME,
})}
</>
</a>
</>
</p>
</div>
)}
</BaseEmailHtml>
);
};
@@ -19,31 +19,39 @@ export default class AttendeeVerifyEmail extends BaseEmail {
return {
to: `${this.verifyAccountInput.user.name} <${this.verifyAccountInput.user.email}>`,
from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,
subject: this.verifyAccountInput.language(
`verify_email_subject${this.verifyAccountInput.isVerifyingEmail ? "_verifying_email" : ""}`,
{
appName: APP_NAME,
}
),
subject: this.verifyAccountInput.hideLogo
? this.verifyAccountInput.language("verify_email_subject_no_branding")
: this.verifyAccountInput.language(
`verify_email_subject${this.verifyAccountInput.isVerifyingEmail ? "_verifying_email" : ""}`,
{ appName: APP_NAME }
),
html: await renderEmail("VerifyEmailByCode", this.verifyAccountInput),
text: this.getTextBody(),
};
}
protected getTextBody(): string {
const subject = this.verifyAccountInput.hideLogo
? this.verifyAccountInput.language("verify_email_subject_no_branding")
: this.verifyAccountInput.language(
`verify_email_subject${this.verifyAccountInput.isVerifyingEmail ? "_verifying_email" : ""}`,
{ appName: APP_NAME }
);
const footer = this.verifyAccountInput.hideLogo
? ""
: `${this.verifyAccountInput.language("happy_scheduling")} ${this.verifyAccountInput.language(
"the_calcom_team",
{ companyName: COMPANY_NAME }
)}`;
return `
${this.verifyAccountInput.language(
`verify_email_subject${this.verifyAccountInput.isVerifyingEmail ? "_verifying_email" : ""}`,
{ appName: APP_NAME }
)}
${subject}
${this.verifyAccountInput.language("verify_email_email_header")}
${this.verifyAccountInput.language("hi_user_name", { name: this.verifyAccountInput.user.name })},
${this.verifyAccountInput.language("verify_email_by_code_email_body")}
${this.verifyAccountInput.verificationEmailCode}
${this.verifyAccountInput.language("happy_scheduling")} ${this.verifyAccountInput.language(
"the_calcom_team",
{ companyName: COMPANY_NAME }
)}
${footer}
`.replace(/(<([^>]+)>)/gi, "");
}
}