# email

## Server

- `sendEmail`

## Schemas/Models

```ts
const EmailSchema = z.object({
  subject: z.string().trim().min(1).max(60),
  body: z.string().trim().min(1),
  to: z.array(z.email()).min(1),
  bcc: z.array(z.email()).optional(),
  cc: z.array(z.email()).optional(),
  attachments: z.array(EmailAttachmentSchema).optional(),
});

const EmailAttachmentSchema = z.object({
  appName: z.string().trim().min(1).max(100),
  subId: z.uuid(),
});
```

## Examples

```ts
import { sendEmail } from "wcz-layout/data/server";

// server
await sendEmail({ data: { subject: "Hello", body: "<p>Hi</p>", to: ["user@example.com"] } });
```
