MCPcopy Index your code
hub / github.com/simstudioai/sim / toResendPayload

Function toResendPayload

apps/sim/lib/messaging/email/providers/resend.ts:14–30  ·  view source on GitHub ↗
(data: ProcessedEmailData)

Source from the content-addressed store, hash-verified

12}
13
14function toResendPayload(data: ProcessedEmailData) {
15 return {
16 from: data.senderEmail,
17 to: data.to,
18 subject: data.subject,
19 html: data.html,
20 text: data.text,
21 replyTo: data.replyTo,
22 headers: Object.keys(data.headers).length > 0 ? data.headers : undefined,
23 attachments: data.attachments?.map((att) => ({
24 filename: att.filename,
25 content: typeof att.content === 'string' ? att.content : att.content.toString('base64'),
26 contentType: att.contentType,
27 disposition: att.disposition || 'attachment',
28 })),
29 }
30}
31
32export function createResendProvider(): MailProvider | null {
33 if (!isConfigured(env.RESEND_API_KEY)) return null

Callers 1

sendFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected