import { z } from "zod";
import { t as sendCustomWorkflowEmail } from "./email-manager-RBMYQEU9.js";
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()
});
async function sendWorkflowEmails(payload) {
  const mailData = ZSendWorkflowEmailsSchema.parse(JSON.parse(payload));
  await Promise.all(
    mailData.to.map(
      (to) => sendCustomWorkflowEmail({
        ...mailData,
        to
      })
    )
  );
}
export {
  ZSendWorkflowEmailsSchema,
  sendWorkflowEmails
};
