mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 16:23:23 +00:00
Add sendEmail workflow with immediate processing option
- Create sendEmailWorkflow as a Payload workflow alternative to task - Add processImmediately option (disabled by default) to send emails immediately - Expose processEmailItem method in MailingService for individual email processing - Add comprehensive input schema with conditional fields - Update plugin to register both tasks and workflows - Add detailed documentation comparing tasks vs workflows - Includes status tracking and error handling - Bump version to 0.3.0 (new feature)
This commit is contained in:
@@ -4,6 +4,7 @@ import { MailingService } from './services/MailingService.js'
|
||||
import { createEmailTemplatesCollection } from './collections/EmailTemplates.js'
|
||||
import Emails from './collections/Emails.js'
|
||||
import { mailingJobs, scheduleEmailsJob } from './jobs/index.js'
|
||||
import { mailingWorkflows } from './workflows/index.js'
|
||||
|
||||
|
||||
export const mailingPlugin = (pluginConfig: MailingPluginConfig) => (config: Config): Config => {
|
||||
@@ -86,6 +87,10 @@ export const mailingPlugin = (pluginConfig: MailingPluginConfig) => (config: Con
|
||||
...(config.jobs?.tasks || []),
|
||||
...mailingJobs,
|
||||
],
|
||||
workflows: [
|
||||
...(config.jobs?.workflows || []),
|
||||
...mailingWorkflows,
|
||||
],
|
||||
},
|
||||
onInit: async (payload: any) => {
|
||||
if (pluginConfig.initOrder === 'after' && config.onInit) {
|
||||
|
||||
Reference in New Issue
Block a user