mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 00:03:23 +00:00
Fix TypeScript build error with payload email adapter
- Update transporter type to handle different email adapter interfaces - Add type casting for payload.email to resolve compatibility issues - Build now completes successfully without TypeScript errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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