mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-13 11:09:29 -05:00
fix: email locale in invite accepted email (#7124)
This commit is contained in:
committed by
GitHub
parent
047750967c
commit
2b526a87ca
@@ -33,7 +33,7 @@ export const resetPasswordAction = actionClient.schema(ZResetPasswordAction).act
|
||||
ctx.auditLoggingCtx.oldObject = oldObject;
|
||||
ctx.auditLoggingCtx.newObject = updatedUser;
|
||||
|
||||
await sendPasswordResetNotifyEmail(updatedUser);
|
||||
await sendPasswordResetNotifyEmail({ email: updatedUser.email, locale: updatedUser.locale });
|
||||
return { success: true };
|
||||
}
|
||||
)
|
||||
|
||||
@@ -69,6 +69,7 @@ describe("invite", () => {
|
||||
creator: {
|
||||
name: "Test User",
|
||||
email: "test@example.com",
|
||||
locale: "en-US",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -89,6 +90,7 @@ describe("invite", () => {
|
||||
select: {
|
||||
name: true,
|
||||
email: true,
|
||||
locale: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -46,6 +46,7 @@ export const getInvite = reactCache(async (inviteId: string): Promise<InviteWith
|
||||
select: {
|
||||
name: true,
|
||||
email: true,
|
||||
locale: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -102,7 +102,12 @@ export const InvitePage = async (props: InvitePageProps) => {
|
||||
);
|
||||
}
|
||||
await deleteInvite(inviteId);
|
||||
await sendInviteAcceptedEmail(invite.creator.name ?? "", user?.name ?? "", invite.creator.email);
|
||||
await sendInviteAcceptedEmail(
|
||||
invite.creator.name ?? "",
|
||||
user?.name ?? "",
|
||||
invite.creator.email,
|
||||
invite.creator.locale
|
||||
);
|
||||
await updateUser(session.user.id, {
|
||||
notificationSettings: {
|
||||
...user.notificationSettings,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Invite } from "@prisma/client";
|
||||
import { TUserLocale } from "@formbricks/types/user";
|
||||
|
||||
export interface InviteWithCreator
|
||||
extends Pick<Invite, "id" | "expiresAt" | "organizationId" | "role" | "teamIds"> {
|
||||
creator: {
|
||||
name: string | null;
|
||||
email: string;
|
||||
locale: TUserLocale;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,12 @@ async function handleInviteAcceptance(
|
||||
},
|
||||
});
|
||||
|
||||
await sendInviteAcceptedEmail(invite.creator.name ?? "", user.name, invite.creator.email);
|
||||
await sendInviteAcceptedEmail(
|
||||
invite.creator.name ?? "",
|
||||
user.name,
|
||||
invite.creator.email,
|
||||
invite.creator.locale
|
||||
);
|
||||
await deleteInvite(invite.id);
|
||||
}
|
||||
|
||||
@@ -168,7 +173,7 @@ async function handlePostUserCreation(
|
||||
}
|
||||
|
||||
if (!emailVerificationDisabled) {
|
||||
await sendVerificationEmail(user);
|
||||
await sendVerificationEmail({ id: user.id, email: user.email, locale: user.locale });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,7 @@ describe("resendVerificationEmailAction", () => {
|
||||
const mockUser = {
|
||||
id: "user123",
|
||||
email: "test@example.com",
|
||||
emailVerified: null, // Not verified
|
||||
name: "Test User",
|
||||
locale: "en-US",
|
||||
};
|
||||
|
||||
const mockVerifiedUser = {
|
||||
|
||||
@@ -32,7 +32,7 @@ export const resendVerificationEmailAction = actionClient.schema(ZResendVerifica
|
||||
};
|
||||
}
|
||||
ctx.auditLoggingCtx.userId = user.id;
|
||||
await sendVerificationEmail(user);
|
||||
await sendVerificationEmail({ id: user.id, email: user.email, locale: user.locale });
|
||||
return {
|
||||
success: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user