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

Method create

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

Source from the content-addressed store, hash-verified

45 }
46
47 create(
48 key: IntegrationTaskKey,
49 payload: Parameters<Resend["batch"]["create"]>[0],
50 options?: Parameters<Resend["batch"]["create"]>[1]
51 ): Promise<CreateEmailResult> {
52 return this.runTask(
53 key,
54 async (client, task) => {
55 const { error, data } = await client.batch.create(payload, options);
56
57 if (error) {
58 throw error;
59 }
60
61 if (!data) {
62 throw new Error("No data returned from Resend");
63 }
64
65 return data;
66 },
67 {
68 name: "Create Batch Email",
69 params: payload,
70 properties: [
71 {
72 label: "Count",
73 text: String(payload.length),
74 },
75 ],
76 retry: retry.standardBackoff,
77 },
78 handleResendError
79 );
80 }
81}

Callers

nothing calls this directly

Calls 2

createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected