MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / sendToAdmins

Function sendToAdmins

app/src/server/emails/sendToAdmins.ts:3–23  ·  view source on GitHub ↗
(projectId: string, callback: (...args: any[]) => Promise<void>)

Source from the content-addressed store, hash-verified

1import { prisma } from "../db";
2
3export async function sendToAdmins(projectId: string, callback: (...args: any[]) => Promise<void>) {
4 const admins = await prisma.projectUser.findMany({
5 where: {
6 projectId: projectId,
7 role: "ADMIN",
8 },
9 select: {
10 user: {
11 select: {
12 email: true,
13 },
14 },
15 },
16 });
17
18 for (const admin of admins) {
19 if (admin.user.email) {
20 await callback(admin.user.email);
21 }
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected