feat: skip pending members in sendMentionEmails

This commit is contained in:
Henry
2026-02-08 22:15:26 +00:00
parent 149277ef39
commit 1f0c780763
4 changed files with 7 additions and 2 deletions

View File

@@ -167,7 +167,6 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
const {
modalContentType,
entityId,
openModal,
getModalState,
clearModalState,
isOpen,
@@ -198,6 +197,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
};
const board = card?.list.board;
const workspaceMembers = board?.workspace.members;
const boardId = board?.publicId;
const updateCard = api.card.update.useMutation({
@@ -286,6 +286,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
if (!cardId) return <></>;
return (
<>
<PageHead
@@ -387,7 +388,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
onBlur={
canEdit ? () => handleSubmit(onSubmit)() : undefined
}
workspaceMembers={board?.workspace.members ?? []}
workspaceMembers={workspaceMembers ?? []}
readOnly={!canEdit}
/>
</div>

View File

@@ -77,6 +77,8 @@ export async function sendMentionEmails({
membersToNotify.map(async (member) => {
const userId = member.user?.id;
const email = member.user?.email ?? member.email;
// Skip pending members (no userId) - they can be mentioned but won't receive emails
if (!userId || !email) return;
try {

View File

@@ -212,6 +212,7 @@ export const getByPublicId = async (
columns: {
publicId: true,
email: true,
status: true,
},
with: {
user: {

View File

@@ -508,6 +508,7 @@ export const getWithListAndMembersByPublicId = async (
columns: {
publicId: true,
email: true,
status: true,
},
with: {
user: {