Created
March 12, 2025 18:27
-
-
Save mmikhan/70601544091893e5422962935a09b6dd to your computer and use it in GitHub Desktop.
Zod mail configuration schema that takes a default empty value for an email field but also can be an empty string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const mailConfigurationSchema = z.object({ | |
apiKey: z.string().default(""), | |
fromEmail: z | |
.string() | |
.email() | |
.optional() | |
.or(z.literal("")) | |
.default(""), | |
toName: z.string().default(""), | |
toEmail: z | |
.string() | |
.email() | |
.optional() | |
.or(z.literal("")) | |
.default(""), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment