"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const z = require("zod");
const index = require("./email-manager-cxUsb_8-.cjs");
const ZSendWorkflowEmailsSchema = z.z.object({
  to: z.z.array(z.z.string()),
  subject: z.z.string(),
  html: z.z.string(),
  replyTo: z.z.string().optional(),
  sender: z.z.string().nullable().optional(),
  attachments: z.z.array(
    z.z.object({
      content: z.z.string(),
      filename: z.z.string()
    }).passthrough()
  ).optional()
});
async function sendWorkflowEmails(payload) {
  const mailData = ZSendWorkflowEmailsSchema.parse(JSON.parse(payload));
  await Promise.all(
    mailData.to.map(
      (to) => index.sendCustomWorkflowEmail({
        ...mailData,
        to
      })
    )
  );
}
exports.ZSendWorkflowEmailsSchema = ZSendWorkflowEmailsSchema;
exports.sendWorkflowEmails = sendWorkflowEmails;
