feat: skip pending members in sendMentionEmails
This commit is contained in:
@@ -167,7 +167,6 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
|
|||||||
const {
|
const {
|
||||||
modalContentType,
|
modalContentType,
|
||||||
entityId,
|
entityId,
|
||||||
openModal,
|
|
||||||
getModalState,
|
getModalState,
|
||||||
clearModalState,
|
clearModalState,
|
||||||
isOpen,
|
isOpen,
|
||||||
@@ -198,6 +197,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const board = card?.list.board;
|
const board = card?.list.board;
|
||||||
|
const workspaceMembers = board?.workspace.members;
|
||||||
const boardId = board?.publicId;
|
const boardId = board?.publicId;
|
||||||
|
|
||||||
const updateCard = api.card.update.useMutation({
|
const updateCard = api.card.update.useMutation({
|
||||||
@@ -286,6 +286,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
|
|||||||
|
|
||||||
if (!cardId) return <></>;
|
if (!cardId) return <></>;
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageHead
|
<PageHead
|
||||||
@@ -387,7 +388,7 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
|
|||||||
onBlur={
|
onBlur={
|
||||||
canEdit ? () => handleSubmit(onSubmit)() : undefined
|
canEdit ? () => handleSubmit(onSubmit)() : undefined
|
||||||
}
|
}
|
||||||
workspaceMembers={board?.workspace.members ?? []}
|
workspaceMembers={workspaceMembers ?? []}
|
||||||
readOnly={!canEdit}
|
readOnly={!canEdit}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ export async function sendMentionEmails({
|
|||||||
membersToNotify.map(async (member) => {
|
membersToNotify.map(async (member) => {
|
||||||
const userId = member.user?.id;
|
const userId = member.user?.id;
|
||||||
const email = member.user?.email ?? member.email;
|
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;
|
if (!userId || !email) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ export const getByPublicId = async (
|
|||||||
columns: {
|
columns: {
|
||||||
publicId: true,
|
publicId: true,
|
||||||
email: true,
|
email: true,
|
||||||
|
status: true,
|
||||||
},
|
},
|
||||||
with: {
|
with: {
|
||||||
user: {
|
user: {
|
||||||
|
|||||||
@@ -508,6 +508,7 @@ export const getWithListAndMembersByPublicId = async (
|
|||||||
columns: {
|
columns: {
|
||||||
publicId: true,
|
publicId: true,
|
||||||
email: true,
|
email: true,
|
||||||
|
status: true,
|
||||||
},
|
},
|
||||||
with: {
|
with: {
|
||||||
user: {
|
user: {
|
||||||
|
|||||||
Reference in New Issue
Block a user