Remove emailWrapper hook and all associated references.

- Simplified email sending logic by dropping custom layout wrapping.
- Updated service, config, types, and readme to remove `emailWrapper` usage.
- Retained focus on core email functionality while ensuring consistent formatting.
This commit is contained in:
2025-09-13 22:31:05 +02:00
parent 31721dc110
commit 2e6feccf54
5 changed files with 9 additions and 368 deletions

View File

@@ -1,20 +1,9 @@
import { Payload } from 'payload'
import type { CollectionConfig, RichTextField, TypedCollection } from 'payload'
import type { CollectionConfig, RichTextField } from 'payload'
import { Transporter } from 'nodemailer'
import {Email} from "../payload-types.js"
export interface EmailObject {
to: string | string[]
cc?: string | string[]
bcc?: string | string[]
from?: string
replyTo?: string
subject: string
html: string
text?: string
variables?: Record<string, any>
}
export type EmailWrapperHook = (email: EmailObject) => EmailObject | Promise<EmailObject>
export type BaseEmail<TEmail = Email, TEmailTemplate = EmailTemplate> = Omit<TEmail, 'id' | 'template'> & {template: Omit<TEmailTemplate, 'id'>}
export type TemplateRendererHook = (template: string, variables: Record<string, any>) => string | Promise<string>
@@ -31,7 +20,6 @@ export interface MailingPluginConfig {
queue?: string
retryAttempts?: number
retryDelay?: number
emailWrapper?: EmailWrapperHook
templateRenderer?: TemplateRendererHook
templateEngine?: TemplateEngine
richTextEditor?: RichTextField['editor']