mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 00:03:23 +00:00
Fix critical typo and improve type safety
- Fix typo: nodemailer.createTransporter -> createTransport - Add type safety check for payload.email with sendMail validation - Prevent runtime errors from invalid transporter objects 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -38,9 +38,9 @@ export class MailingService implements IMailingService {
|
||||
if ('sendMail' in this.config.transport) {
|
||||
this.transporter = this.config.transport
|
||||
} else {
|
||||
this.transporter = nodemailer.createTransporter(this.config.transport as MailingTransportConfig)
|
||||
this.transporter = nodemailer.createTransport(this.config.transport as MailingTransportConfig)
|
||||
}
|
||||
} else if (this.payload.email) {
|
||||
} else if (this.payload.email && 'sendMail' in this.payload.email) {
|
||||
// Use Payload's configured mailer
|
||||
this.transporter = this.payload.email
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user