MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / extractRecipient

Function extractRecipient

apps/api/src/api/webhooks/resend.utils.ts:192–204  ·  view source on GitHub ↗
(event: IResendEventBase)

Source from the content-addressed store, hash-verified

190};
191
192const extractRecipient = (event: IResendEventBase): string | null => {
193 const to = event.data?.to;
194
195 if (Array.isArray(to)) {
196 return typeof to[0] === "string" && to[0] !== "" ? to[0] : null;
197 }
198
199 if (typeof to === "string" && to !== "") {
200 return to;
201 }
202
203 return null;
204};
205
206/**
207 * Side-effect: persist a suppression row for a Resend event when the

Callers 1

applyResendEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected