mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 16:23:23 +00:00
Merge pull request #13 from xtr-dev/dev
Fix TypeScript build error with payload email adapter
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-mailing",
|
"name": "@xtr-dev/payload-mailing",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"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",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { serializeRichTextToHTML, serializeRichTextToText } from '../utils/richT
|
|||||||
export class MailingService implements IMailingService {
|
export class MailingService implements IMailingService {
|
||||||
private payload: Payload
|
private payload: Payload
|
||||||
private config: MailingPluginConfig
|
private config: MailingPluginConfig
|
||||||
private transporter!: Transporter
|
private transporter!: Transporter | any
|
||||||
private templatesCollection: string
|
private templatesCollection: string
|
||||||
private emailsCollection: string
|
private emailsCollection: string
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ export class MailingService implements IMailingService {
|
|||||||
this.transporter = nodemailer.createTransport(this.config.transport as MailingTransportConfig)
|
this.transporter = nodemailer.createTransport(this.config.transport as MailingTransportConfig)
|
||||||
}
|
}
|
||||||
} else if (this.payload.email && 'sendMail' in this.payload.email) {
|
} else if (this.payload.email && 'sendMail' in this.payload.email) {
|
||||||
// Use Payload's configured mailer
|
// Use Payload's configured mailer (cast to any to handle different adapter types)
|
||||||
this.transporter = this.payload.email
|
this.transporter = this.payload.email as any
|
||||||
} else {
|
} else {
|
||||||
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