Skip to content

Scheduling infrastructure for absolutely everyone.

fix: phone number in confirmation email (#18642)

Udit Takkar30180edc0ba7
diff --git a/packages/emails/src/components/WhoInfo.tsx b/packages/emails/src/components/WhoInfo.tsx
index da3023513aa..0b3f1992210 100644
--- a/packages/emails/src/components/WhoInfo.tsx
+++ b/packages/emails/src/components/WhoInfo.tsx
@@ -5,18 +5,23 @@ import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
-export const PersonInfo = ({ name = "", email = "", role = "", phoneNumber = "" }) => (
- <div style={{ color: "#101010", fontWeight: 400, lineHeight: "24px" }}>
- {name} - {role} {phoneNumber}
- {!isSmsCalEmail(email) && (
- <span style={{ color: "#4B5563" }}>
- <a href={`mailto:${email}`} style={{ color: "#4B5563" }}>
- {email}
- </a>
- </span>
- )}
- </div>
-);
+export const PersonInfo = ({ name = "", email = "", role = "", phoneNumber = "" }) => {
+ const displayEmail = !isSmsCalEmail(email);
+ const formattedPhoneNumber = !!phoneNumber ? `${phoneNumber} ` : "";
+
+ return (
+ <div style={{ color: "#101010", fontWeight: 400, lineHeight: "24px" }}>
+ {name} - {role} {formattedPhoneNumber}
+ {displayEmail && (
+ <span style={{ color: "#4B5563" }}>
+ <a href={`mailto:${email}`} style={{ color: "#4B5563" }}>
+ {email}
+ </a>
+ </span>
+ )}
+ </div>
+ );
+};
export function WhoInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
const { t } = props;
diff --git a/packages/lib/CalEventParser.ts b/packages/lib/CalEventParser.ts
index 4872ddd0bca..caf00bf44d1 100644
--- a/packages/lib/CalEventParser.ts
+++ b/packages/lib/CalEventParser.ts
@@ -55,10 +55,8 @@ export const getWho = (
return `
${attendee?.name || t("guest")}
${!isSmsCalEmail(attendee.email) ? `${attendee.email}\n` : `${attendee.phoneNumber}\n`}
-
`;
})
-
.join("");
const organizer = `