mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 16:23:23 +00:00
Merge pull request #39 from xtr-dev/dev
Remove redundant queueName validation and debug log, bump version to …
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-mailing",
|
"name": "@xtr-dev/payload-mailing",
|
||||||
"version": "0.1.23",
|
"version": "0.1.24",
|
||||||
"description": "Template-based email system with scheduling and job processing for PayloadCMS",
|
"description": "Template-based email system with scheduling and job processing for PayloadCMS",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -9,12 +9,6 @@ import { mailingJobs, scheduleEmailsJob } from './jobs/index.js'
|
|||||||
export const mailingPlugin = (pluginConfig: MailingPluginConfig) => (config: Config): Config => {
|
export const mailingPlugin = (pluginConfig: MailingPluginConfig) => (config: Config): Config => {
|
||||||
const queueName = pluginConfig.queue || 'default'
|
const queueName = pluginConfig.queue || 'default'
|
||||||
|
|
||||||
// Validate queueName
|
|
||||||
if (!queueName || typeof queueName !== 'string') {
|
|
||||||
throw new Error('Invalid queue configuration: queue must be a non-empty string')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Handle templates collection configuration
|
// Handle templates collection configuration
|
||||||
const templatesConfig = pluginConfig.collections?.templates
|
const templatesConfig = pluginConfig.collections?.templates
|
||||||
const templatesSlug = typeof templatesConfig === 'string' ? templatesConfig : 'email-templates'
|
const templatesSlug = typeof templatesConfig === 'string' ? templatesConfig : 'email-templates'
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export class MailingService implements IMailingService {
|
|||||||
// Use Payload's configured mailer (cast to any to handle different adapter types)
|
// Use Payload's configured mailer (cast to any to handle different adapter types)
|
||||||
this.transporter = this.payload.email as any
|
this.transporter = this.payload.email as any
|
||||||
} else {
|
} else {
|
||||||
console.log('[DEBUG] email: ', this.payload.email);
|
|
||||||
throw new Error('Email transport configuration is required either in plugin config or Payload config')
|
throw new Error('Email transport configuration is required either in plugin config or Payload config')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user