fix: Use booker locale for email verification email (#25420)
This commit is contained in:
@@ -27,7 +27,7 @@ export const useVerifyEmail = ({
|
||||
const debouncedEmail = useDebounce(email, 600);
|
||||
const { data: session } = useSession();
|
||||
|
||||
const { t } = useLocale();
|
||||
const { t, i18n } = useLocale();
|
||||
const sendEmailVerificationByCodeMutation = trpc.viewer.auth.sendVerifyEmailCode.useMutation({
|
||||
onSuccess: () => {
|
||||
setEmailVerificationModalVisible(true);
|
||||
@@ -55,6 +55,7 @@ export const useVerifyEmail = ({
|
||||
sendEmailVerificationByCodeMutation.mutate({
|
||||
email,
|
||||
username: typeof name === "string" ? name : name?.firstName,
|
||||
language: i18n.language || "en",
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1168,6 +1168,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
sendEmailVerificationCodeMutation.mutate({
|
||||
email,
|
||||
isVerifyingEmail: true,
|
||||
language: i18n.language || "en",
|
||||
});
|
||||
}}>
|
||||
{t("send_code")}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { z } from "zod";
|
||||
export const ZSendVerifyEmailCodeSchema = z.object({
|
||||
email: z.string().min(1),
|
||||
username: z.string().optional(),
|
||||
language: z.string().optional(),
|
||||
language: z.string(),
|
||||
isVerifyingEmail: z.boolean().optional(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user