♻️ (models) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
a9d04798bc
commit
a5c8a8a95c
@ -0,0 +1,31 @@
|
||||
import { z } from 'zod'
|
||||
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||
|
||||
export const sendEmailOptionsSchema = z.object({
|
||||
credentialsId: z.string(),
|
||||
isCustomBody: z.boolean().optional(),
|
||||
isBodyCode: z.boolean().optional(),
|
||||
recipients: z.array(z.string()),
|
||||
subject: z.string().optional(),
|
||||
body: z.string().optional(),
|
||||
replyTo: z.string().optional(),
|
||||
cc: z.array(z.string()).optional(),
|
||||
bcc: z.array(z.string()).optional(),
|
||||
attachmentsVariableId: z.string().optional(),
|
||||
})
|
||||
|
||||
export const sendEmailBlockSchema = blockBaseSchema.and(
|
||||
z.object({
|
||||
type: z.enum([IntegrationBlockType.EMAIL]),
|
||||
options: sendEmailOptionsSchema,
|
||||
})
|
||||
)
|
||||
|
||||
export const defaultSendEmailOptions: SendEmailOptions = {
|
||||
credentialsId: 'default',
|
||||
isCustomBody: false,
|
||||
recipients: [],
|
||||
}
|
||||
|
||||
export type SendEmailBlock = z.infer<typeof sendEmailBlockSchema>
|
||||
export type SendEmailOptions = z.infer<typeof sendEmailOptionsSchema>
|
Reference in New Issue
Block a user