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

Method send

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

Source from the content-addressed store, hash-verified

13 constructor(private runTask: ResendRunTask) {}
14
15 send(
16 key: IntegrationTaskKey,
17 payload: Parameters<Resend["emails"]["send"]>[0],
18 options?: Parameters<Resend["emails"]["send"]>[1]
19 ): Promise<SendEmailResult> {
20 return this.runTask(
21 key,
22 async (client, task) => {
23 const { error, data } = await client.emails.send(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: "Send Email",
37 params: payload,
38 properties: [
39 {
40 label: "From",
41 text: payload.from,
42 },
43 {
44 label: "To",
45 text: Array.isArray(payload.to) ? payload.to.join(", ") : payload.to,
46 },
47 ...(payload.subject ? [{ label: "Subject", text: payload.subject }] : []),
48 ],
49 retry: retry.standardBackoff,
50 },
51 handleResendError
52 );
53 }
54
55 create(
56 key: IntegrationTaskKey,

Callers

nothing calls this directly

Calls 2

sendMethod · 0.65
runTaskMethod · 0.45

Tested by

no test coverage detected