MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / hasEmailBeenSent

Method hasEmailBeenSent

server/src/db/email-db.ts:121–135  ·  view source on GitHub ↗

* Check if we've already sent a specific email type to a user

(data: {
    email_type: string;
    workos_user_id: string;
  })

Source from the content-addressed store, hash-verified

119 * Check if we've already sent a specific email type to a user
120 */
121 async hasEmailBeenSent(data: {
122 email_type: string;
123 workos_user_id: string;
124 }): Promise<boolean> {
125 const result = await query<{ exists: boolean }>(
126 `SELECT EXISTS(
127 SELECT 1 FROM email_events
128 WHERE email_type = $1
129 AND workos_user_id = $2
130 AND sent_at IS NOT NULL
131 ) as exists`,
132 [data.email_type, data.workos_user_id]
133 );
134 return result.rows[0]?.exists || false;
135 }
136
137 /**
138 * Record a click event

Callers 2

hasSignupEmailBeenSentFunction · 0.80
hasSlackInviteBeenSentFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected