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