mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 08:13:23 +00:00
Fix TypeScript compatibility with PayloadCMS generated types
Resolves: TS2344: Type Email does not satisfy the constraint BaseEmailData - Add null support to BaseEmailData interface for all optional fields - Update parseAndValidateEmails to handle null values - Update sendEmail validation to properly check for null values - Maintain compatibility with PayloadCMS generated types that include null Generated Email types like cc?: string[] | null | undefined now work correctly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,8 @@ import { TemplateVariables } from '../types/index.js'
|
||||
* Parse and validate email addresses
|
||||
* @internal
|
||||
*/
|
||||
export const parseAndValidateEmails = (emails: string | string[] | undefined): string[] | undefined => {
|
||||
if (!emails) return undefined
|
||||
export const parseAndValidateEmails = (emails: string | string[] | null | undefined): string[] | undefined => {
|
||||
if (!emails || emails === null) return undefined
|
||||
|
||||
let emailList: string[]
|
||||
if (Array.isArray(emails)) {
|
||||
|
||||
Reference in New Issue
Block a user