fix: check for recipients to send project access email

This commit is contained in:
Scott Wilson
2025-05-28 16:45:43 -07:00
parent bd4cf64fc6
commit 286dc39ed2

View File

@@ -198,15 +198,17 @@ export const orgAdminServiceFactory = ({
)
.map((el) => el.user.email!);
await smtpService.sendMail({
template: SmtpTemplates.OrgAdminProjectDirectAccess,
recipients: filteredProjectMembers,
subjectLine: "Organization Admin Project Direct Access Issued",
substitutions: {
projectName: project.name,
email: projectMembers.find((el) => el.userId === actorId)?.user?.username
}
});
if (filteredProjectMembers.length) {
await smtpService.sendMail({
template: SmtpTemplates.OrgAdminProjectDirectAccess,
recipients: filteredProjectMembers,
subjectLine: "Organization Admin Project Direct Access Issued",
substitutions: {
projectName: project.name,
email: projectMembers.find((el) => el.userId === actorId)?.user?.username
}
});
}
return { isExistingMember: false, membership: updatedMembership };
};