mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-11 00:33:23 +00:00
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user