Files
calendar/packages/features/tasker/tasks/sendWorkflowEmails.ts
T
Anik Dhabal BabuandGitHub 2923684c7c fix: exclude email from replyTo (#20953)
* fix: exclude email from replyTo

* update

* Update scheduleEmailReminders.ts
2025-04-24 19:20:45 +00:00

35 lines
750 B
TypeScript

import { z } from "zod";
import { sendCustomWorkflowEmail } from "@calcom/emails";
export const ZSendWorkflowEmailsSchema = z.object({
to: z.array(z.string()),
subject: z.string(),
html: z.string(),
replyTo: z.string().optional(),
sender: z.string().nullable().optional(),
attachments: z
.array(
z
.object({
content: z.string(),
filename: z.string(),
})
.passthrough()
)
.optional(),
});
export async function sendWorkflowEmails(payload: string): Promise<void> {
const mailData = ZSendWorkflowEmailsSchema.parse(JSON.parse(payload));
await Promise.all(
mailData.to.map((to) =>
sendCustomWorkflowEmail({
...mailData,
to,
})
)
);
}