mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 08:13:23 +00:00
Remove duplicate BaseEmailDocument definition
- Remove duplicate BaseEmailDocument interface from sendEmail.ts - Import BaseEmailDocument from types/index.ts instead - Update sendEmailTask.ts to import from types/index.ts - Maintain single source of truth for BaseEmailDocument type definition 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ export { mailingJobs, sendEmailJob } from './jobs/index.js'
|
|||||||
export type { SendEmailTaskInput } from './jobs/sendEmailTask.js'
|
export type { SendEmailTaskInput } from './jobs/sendEmailTask.js'
|
||||||
|
|
||||||
// Main email sending function
|
// Main email sending function
|
||||||
export { sendEmail, type SendEmailOptions, type BaseEmailDocument } from './sendEmail.js'
|
export { sendEmail, type SendEmailOptions } from './sendEmail.js'
|
||||||
export { default as sendEmailDefault } from './sendEmail.js'
|
export { default as sendEmailDefault } from './sendEmail.js'
|
||||||
|
|
||||||
// Utility functions for developers
|
// Utility functions for developers
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { sendEmail, BaseEmailDocument } from '../sendEmail.js'
|
import { sendEmail } from '../sendEmail.js'
|
||||||
|
import { BaseEmailDocument } from '../types/index.js'
|
||||||
|
|
||||||
export interface SendEmailTaskInput {
|
export interface SendEmailTaskInput {
|
||||||
// Template mode fields
|
// Template mode fields
|
||||||
|
|||||||
@@ -1,29 +1,6 @@
|
|||||||
import { Payload } from 'payload'
|
import { Payload } from 'payload'
|
||||||
import { getMailing, renderTemplate, parseAndValidateEmails } from './utils/helpers.js'
|
import { getMailing, renderTemplate, parseAndValidateEmails } from './utils/helpers.js'
|
||||||
|
import { BaseEmailDocument } from './types/index.js'
|
||||||
// Generic email interface that can work with any ID type
|
|
||||||
export interface BaseEmailDocument {
|
|
||||||
id: string | number
|
|
||||||
template?: any
|
|
||||||
to: string[]
|
|
||||||
cc?: string[]
|
|
||||||
bcc?: string[]
|
|
||||||
from?: string
|
|
||||||
replyTo?: string
|
|
||||||
subject: string
|
|
||||||
html: string
|
|
||||||
text?: string
|
|
||||||
variables?: Record<string, any>
|
|
||||||
scheduledAt?: string
|
|
||||||
sentAt?: string
|
|
||||||
status?: 'pending' | 'processing' | 'sent' | 'failed'
|
|
||||||
attempts?: number
|
|
||||||
lastAttemptAt?: string
|
|
||||||
error?: string
|
|
||||||
priority?: number
|
|
||||||
createdAt?: string
|
|
||||||
updatedAt?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Options for sending emails
|
// Options for sending emails
|
||||||
export interface SendEmailOptions<T extends BaseEmailDocument = BaseEmailDocument> {
|
export interface SendEmailOptions<T extends BaseEmailDocument = BaseEmailDocument> {
|
||||||
|
|||||||
Reference in New Issue
Block a user