mirror of
https://github.com/xtr-dev/payload-automation.git
synced 2025-12-15 02:53:23 +00:00
Initial commit
This commit is contained in:
79
src/steps/send-email.ts
Normal file
79
src/steps/send-email.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { TaskConfig } from "payload"
|
||||
|
||||
import { sendEmailHandler } from "./send-email-handler.js"
|
||||
|
||||
export const SendEmailStepTask = {
|
||||
slug: 'send-email',
|
||||
handler: sendEmailHandler,
|
||||
inputSchema: [
|
||||
{
|
||||
name: 'to',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Recipient email address'
|
||||
},
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: 'from',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Sender email address (optional, uses default if not provided)'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'subject',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Email subject line'
|
||||
},
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: 'text',
|
||||
type: 'textarea',
|
||||
admin: {
|
||||
description: 'Plain text email content'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'html',
|
||||
type: 'textarea',
|
||||
admin: {
|
||||
description: 'HTML email content (optional)'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'cc',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'CC recipients'
|
||||
},
|
||||
hasMany: true
|
||||
},
|
||||
{
|
||||
name: 'bcc',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'BCC recipients'
|
||||
},
|
||||
hasMany: true
|
||||
}
|
||||
],
|
||||
outputSchema: [
|
||||
{
|
||||
name: 'messageId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Email message ID from the mail server'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'response',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Response from the mail server'
|
||||
}
|
||||
}
|
||||
]
|
||||
} satisfies TaskConfig<'send-email'>
|
||||
Reference in New Issue
Block a user