diff --git a/packages/features/bookings/Booker/components/hooks/useBookingForm.ts b/packages/features/bookings/Booker/components/hooks/useBookingForm.ts index 0191e71c9b..45d4068824 100644 --- a/packages/features/bookings/Booker/components/hooks/useBookingForm.ts +++ b/packages/features/bookings/Booker/components/hooks/useBookingForm.ts @@ -23,6 +23,7 @@ export interface IUseBookingForm { name: string | null; }; lastBookingResponse?: Record; + clientId?: string; } export type UseBookingFormReturnType = ReturnType; @@ -36,6 +37,7 @@ export const useBookingForm = ({ extraOptions, prefillFormParams, lastBookingResponse, + clientId, }: IUseBookingForm) => { const rescheduleUid = useBookerStore((state) => state.rescheduleUid); const bookingData = useBookerStore((state) => state.bookingData); @@ -75,6 +77,7 @@ export const useBookingForm = ({ extraOptions, prefillFormParams, lastBookingResponse, + clientId, }); const bookingForm = useForm({ diff --git a/packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts b/packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts index 143f424485..1ad8539eff 100644 --- a/packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts +++ b/packages/features/bookings/Booker/components/hooks/useInitialFormValues.ts @@ -22,6 +22,7 @@ type UseInitialFormValuesProps = { name: string | null; }; lastBookingResponse?: Record; + clientId?: string; }; // Add this stable hash function @@ -63,6 +64,7 @@ export function useInitialFormValues({ extraOptions, prefillFormParams, lastBookingResponse, + clientId, }: UseInitialFormValuesProps) { const stableHashExtraOptions = getStableHash(extraOptions); @@ -120,6 +122,10 @@ export function useInitialFormValues({ : name ?? username ?? parsedLastBookingResponse?.name ?? "", }; + if (clientId) { + defaultUserValues.email = defaultUserValues.email.replace(`+${clientId}`, ""); + } + if (!isRescheduling) { const defaults = { responses: {} as Partial>>, diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx index 87e87d75f9..6902cd6335 100644 --- a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx +++ b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx @@ -340,6 +340,7 @@ export const BookerPlatformWrapper = ( hasSession, extraOptions: extraOptions ?? {}, prefillFormParams: prefillFormParams, + clientId, }); const { mutate: createBooking,