MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / create

Method create

integrations/resend/src/contacts.ts:15–51  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    payload: Parameters<Resend["contacts"]["create"]>[0],
    options?: Parameters<Resend["contacts"]["create"]>[1]
  )

Source from the content-addressed store, hash-verified

13 constructor(private runTask: ResendRunTask) {}
14
15 create(
16 key: IntegrationTaskKey,
17 payload: Parameters<Resend["contacts"]["create"]>[0],
18 options?: Parameters<Resend["contacts"]["create"]>[1]
19 ): Promise<CreateContactResult> {
20 return this.runTask(
21 key,
22 async (client, task) => {
23 const { error, data } = await client.contacts.create(payload, options);
24
25 if (error) {
26 throw error;
27 }
28
29 if (!data) {
30 throw new Error("No data returned from Resend");
31 }
32
33 return data;
34 },
35 {
36 name: "Create Contact",
37 params: payload,
38 properties: [
39 {
40 label: "Email",
41 text: payload.email,
42 },
43 ...(payload.first_name && payload.last_name
44 ? [{ label: "Name", text: payload.first_name + " " + payload.last_name }]
45 : []),
46 ],
47 retry: retry.standardBackoff,
48 },
49 handleResendError
50 );
51 }
52
53 get(
54 key: IntegrationTaskKey,

Callers

nothing calls this directly

Calls 2

createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected