Refactor email types for enhanced consistency and type safety

- Replace `EmailTemplate` with `BaseEmailTemplate` for stricter type validation.
- Update `sendEmail` and `sendEmailTask` to utilize refined `BaseEmail` structure.
- Simplify type definitions in `MailingService` and related modules.
This commit is contained in:
2025-09-13 23:00:41 +02:00
parent e91ab7e54e
commit 9520ec5ed1
4 changed files with 18 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
import { sendEmail } from '../sendEmail.js'
import { Email } from '../payload-types.js'
import {Email, EmailTemplate} from '../payload-types.js'
import {BaseEmail} from "../types/index.js"
export interface SendEmailTaskInput {
@@ -161,7 +161,7 @@ export const sendEmailJob = {
})
// Use the sendEmail helper to create the email
const email = await sendEmail<BaseEmail>(payload, sendEmailOptions)
const email = await sendEmail<Email, EmailTemplate>(payload, sendEmailOptions)
return {
output: {