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

Method create

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

Source from the content-addressed store, hash-verified

53 }
54
55 create(
56 key: IntegrationTaskKey,
57 payload: Parameters<Resend["emails"]["create"]>[0],
58 options?: Parameters<Resend["emails"]["create"]>[1]
59 ): Promise<CreateEmailResult> {
60 return this.runTask(
61 key,
62 async (client, task) => {
63 const { error, data } = await client.emails.create(payload, options);
64
65 if (error) {
66 throw error;
67 }
68
69 if (!data) {
70 throw new Error("No data returned from Resend");
71 }
72
73 return data;
74 },
75 {
76 name: "Create Email",
77 params: payload,
78 properties: [
79 {
80 label: "From",
81 text: payload.from,
82 },
83 {
84 label: "To",
85 text: Array.isArray(payload.to) ? payload.to.join(", ") : payload.to,
86 },
87 ...(payload.subject ? [{ label: "Subject", text: payload.subject }] : []),
88 ],
89 retry: retry.standardBackoff,
90 },
91 handleResendError
92 );
93 }
94
95 get(key: IntegrationTaskKey, payload: string): Promise<GetEmailResult> {
96 return this.runTask(

Callers

nothing calls this directly

Calls 2

createMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected