From 30180edc0ba7f9de6502aa1cfaca71da9c4d97a0 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:57:24 +0530 Subject: [PATCH] fix: phone number in confirmation email (#18642) Co-authored-by: Peer Richelsen --- packages/emails/src/components/WhoInfo.tsx | 29 +++++++++++++--------- packages/lib/CalEventParser.ts | 2 -- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/emails/src/components/WhoInfo.tsx b/packages/emails/src/components/WhoInfo.tsx index da3023513a..0b3f199221 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 = "" }) => ( -
- {name} - {role} {phoneNumber} - {!isSmsCalEmail(email) && ( - - - {email} - - - )} -
-); +export const PersonInfo = ({ name = "", email = "", role = "", phoneNumber = "" }) => { + const displayEmail = !isSmsCalEmail(email); + const formattedPhoneNumber = !!phoneNumber ? `${phoneNumber} ` : ""; + + return ( +
+ {name} - {role} {formattedPhoneNumber} + {displayEmail && ( + + + {email} + + + )} +
+ ); +}; export function WhoInfo(props: { calEvent: CalendarEvent; t: TFunction }) { const { t } = props; diff --git a/packages/lib/CalEventParser.ts b/packages/lib/CalEventParser.ts index 4872ddd0bc..caf00bf44d 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 = `